Browse Source

Code and doc lint

Matthew Wang 11 years ago
parent
commit
e4eccf3fbc
2 changed files with 10 additions and 9 deletions
  1. 1
    1
      README.rst
  2. 9
    8
      cdiff.py

+ 1
- 1
README.rst View File

@@ -78,7 +78,7 @@ Read the log (e.g. ``git log -p``) in a *Git/Mercurial/Svn* workspace:
78 78
 
79 79
     cd proj-workspace
80 80
     cdiff -l
81
-    cdiff -ls                   # equivalent to ``cdiff -l -s``
81
+    cdiff -ls                   # equivalent to cdiff -l -s
82 82
     cdiff -ls -w90
83 83
 
84 84
 Pipe in a diff:

+ 9
- 8
cdiff.py View File

@@ -84,8 +84,9 @@ class Hunk(object):
84 84
         self._hunk_list = []        # list of tuple (attr, line)
85 85
 
86 86
     def append(self, hunk_line):
87
-        """hunk_line is a 2-element tuple: (attr, text), where attris : '-':
88
-        old, '+': new, ' ': common"""
87
+        """hunk_line is a 2-element tuple: (attr, text), where attr is:
88
+                '-': old, '+': new, ' ': common
89
+        """
89 90
         self._hunk_list.append(hunk_line)
90 91
 
91 92
     def mdiff(self):
@@ -146,13 +147,13 @@ class Diff(object):
146 147
         return False
147 148
 
148 149
     def parse_hunk_meta(self, line):
149
-        """Returns a 2-element tuple, each of them is a tuple in form of (start,
150
-        offset)"""
150
+        """Returns a 2-element tuple, each is a tuple of (start, offset)"""
151 151
         return None
152 152
 
153 153
     def parse_hunk_line(self, line):
154
-        """Returns a 2-element tuple: (attr, text), where attr is: '-': old,
155
-        '+': new, ' ': common"""
154
+        """Returns a 2-element tuple: (attr, text), where attr is:
155
+                '-': old, '+': new, ' ': common
156
+        """
156 157
         return None
157 158
 
158 159
     def is_old(self, line):
@@ -219,8 +220,8 @@ class Diff(object):
219 220
 
220 221
         def _fit_with_marker_mix(text, base_color, width, pad=False):
221 222
             """Wrap or pad input text which contains mdiff tags, markup at the
222
-            meantime with the markup_fix_fn, note only left side need to set
223
-            `pad`"""
223
+            meantime, note only left side need to set `pad`
224
+            """
224 225
             out = [COLORS[base_color]]
225 226
             count = 0
226 227
             tag_re = re.compile(r'\x00[+^-]|\x01')