Parcourir la source

Fix formatting of docstrings for compatibility with pydoctor.

Jelmer Vernooij il y a 13 ans
Parent
commit
59835c0ab2
2 fichiers modifiés avec 31 ajouts et 29 suppressions
  1. 25 23
      dulwich/pack.py
  2. 6 6
      dulwich/tests/utils.py

+ 25 - 23
dulwich/pack.py

@@ -199,10 +199,10 @@ def read_zlib_chunks(read_some, unpacked, include_comp=False,
         attr is not None, the CRC32 of the compressed bytes will be computed
         attr is not None, the CRC32 of the compressed bytes will be computed
         using this starting CRC32.
         using this starting CRC32.
         After this function, will have the following attrs set:
         After this function, will have the following attrs set:
-            comp_chunks    (if include_comp is True)
-            decomp_chunks
-            decomp_len
-            crc32
+        * comp_chunks    (if include_comp is True)
+        * decomp_chunks
+        * decomp_len
+        * crc32
     :param include_comp: If True, include compressed data in the result.
     :param include_comp: If True, include compressed data in the result.
     :param buffer_size: Size of the read buffer.
     :param buffer_size: Size of the read buffer.
     :return: Leftover unused data from the decompression.
     :return: Leftover unused data from the decompression.
@@ -658,15 +658,16 @@ def unpack_object(read_all, read_some=None, compute_crc32=False,
     :param include_comp: If True, include compressed data in the result.
     :param include_comp: If True, include compressed data in the result.
     :param zlib_bufsize: An optional buffer size for zlib operations.
     :param zlib_bufsize: An optional buffer size for zlib operations.
     :return: A tuple of (unpacked, unused), where unused is the unused data
     :return: A tuple of (unpacked, unused), where unused is the unused data
-        leftover from decompression, and unpacked i an UnpackedObject with the
-        following attrs set:
-            obj_chunks     (for non-delta types)
-            pack_type_num
-            delta_base     (for delta types)
-            comp_chunks    (if include_comp is True)
-            decomp_chunks
-            decomp_len
-            crc32          (if compute_crc32 is True)
+        leftover from decompression, and unpacked in an UnpackedObject with
+        the following attrs set:
+
+        * obj_chunks     (for non-delta types)
+        * pack_type_num
+        * delta_base     (for delta types)
+        * comp_chunks    (if include_comp is True)
+        * decomp_chunks
+        * decomp_len
+        * crc32          (if compute_crc32 is True)
     """
     """
     if read_some is None:
     if read_some is None:
         read_some = read_all
         read_some = read_all
@@ -1169,15 +1170,16 @@ class DeltaChainIterator(object):
 
 
     Subclasses can override _result to define the result type of the iterator.
     Subclasses can override _result to define the result type of the iterator.
     By default, results are UnpackedObjects with the following members set:
     By default, results are UnpackedObjects with the following members set:
-        offset
-        obj_type_num
-        obj_chunks
-        pack_type_num
-        delta_base     (for delta types)
-        comp_chunks    (if _include_comp is True)
-        decomp_chunks
-        decomp_len
-        crc32          (if _compute_crc32 is True)
+
+    * offset
+    * obj_type_num
+    * obj_chunks
+    * pack_type_num
+    * delta_base     (for delta types)
+    * comp_chunks    (if _include_comp is True)
+    * decomp_chunks
+    * decomp_len
+    * crc32          (if _compute_crc32 is True)
     """
     """
 
 
     _compute_crc32 = False
     _compute_crc32 = False
@@ -1363,7 +1365,7 @@ def pack_object_header(type_num, delta_base, size):
     :param type_num: Numeric type of the object.
     :param type_num: Numeric type of the object.
     :param delta_base: Delta base offset or ref, or None for whole objects.
     :param delta_base: Delta base offset or ref, or None for whole objects.
     :param size: Uncompressed object size.
     :param size: Uncompressed object size.
-    :return A header for a packed object.
+    :return: A header for a packed object.
     """
     """
     header = ''
     header = ''
     c = (type_num << 4) | (size & 15)
     c = (type_num << 4) | (size & 15)

+ 6 - 6
dulwich/tests/utils.py

@@ -166,15 +166,15 @@ def build_pack(f, objects_spec, store=None):
     :param f: A file-like object to write the pack to.
     :param f: A file-like object to write the pack to.
     :param objects_spec: A list of (type_num, obj). For non-delta types, obj
     :param objects_spec: A list of (type_num, obj). For non-delta types, obj
         is the string of that object's data.
         is the string of that object's data.
-
         For delta types, obj is a tuple of (base, data), where:
         For delta types, obj is a tuple of (base, data), where:
-          base can be either an index in objects_spec of the base for that
-          delta; or for a ref delta, a SHA, in which case the resulting pack
-          will be thin and the base will be an external ref.
-          data is a string of the full, non-deltified data for that object.
+
+        * base can be either an index in objects_spec of the base for that
+        * delta; or for a ref delta, a SHA, in which case the resulting pack
+        * will be thin and the base will be an external ref.
+        * data is a string of the full, non-deltified data for that object.
+
         Note that offsets/refs and deltas are computed within this function.
         Note that offsets/refs and deltas are computed within this function.
     :param store: An optional ObjectStore for looking up external refs.
     :param store: An optional ObjectStore for looking up external refs.
-
     :return: A list of tuples in the order specified by objects_spec:
     :return: A list of tuples in the order specified by objects_spec:
         (offset, type num, data, sha, CRC32)
         (offset, type num, data, sha, CRC32)
     """
     """