Przeglądaj źródła

Code and doc lint

Matthew Wang 11 lat temu
rodzic
commit
e4eccf3fbc
2 zmienionych plików z 10 dodań i 9 usunięć
  1. 1
    1
      README.rst
  2. 9
    8
      cdiff.py

+ 1
- 1
README.rst Wyświetl plik

78
 
78
 
79
     cd proj-workspace
79
     cd proj-workspace
80
     cdiff -l
80
     cdiff -l
81
-    cdiff -ls                   # equivalent to ``cdiff -l -s``
81
+    cdiff -ls                   # equivalent to cdiff -l -s
82
     cdiff -ls -w90
82
     cdiff -ls -w90
83
 
83
 
84
 Pipe in a diff:
84
 Pipe in a diff:

+ 9
- 8
cdiff.py Wyświetl plik

84
         self._hunk_list = []        # list of tuple (attr, line)
84
         self._hunk_list = []        # list of tuple (attr, line)
85
 
85
 
86
     def append(self, hunk_line):
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
         self._hunk_list.append(hunk_line)
90
         self._hunk_list.append(hunk_line)
90
 
91
 
91
     def mdiff(self):
92
     def mdiff(self):
146
         return False
147
         return False
147
 
148
 
148
     def parse_hunk_meta(self, line):
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
         return None
151
         return None
152
 
152
 
153
     def parse_hunk_line(self, line):
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
         return None
157
         return None
157
 
158
 
158
     def is_old(self, line):
159
     def is_old(self, line):
219
 
220
 
220
         def _fit_with_marker_mix(text, base_color, width, pad=False):
221
         def _fit_with_marker_mix(text, base_color, width, pad=False):
221
             """Wrap or pad input text which contains mdiff tags, markup at the
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
             out = [COLORS[base_color]]
225
             out = [COLORS[base_color]]
225
             count = 0
226
             count = 0
226
             tag_re = re.compile(r'\x00[+^-]|\x01')
227
             tag_re = re.compile(r'\x00[+^-]|\x01')