Sfoglia il codice sorgente

revert debug code; clean up

Matthew Wang 11 anni fa
parent
commit
8f1aa45c8b
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 2
    1
      cdiff.py
  2. 1
    2
      tests/test_cdiff.py

+ 2
- 1
cdiff.py Vedi File

@@ -263,12 +263,13 @@ class Diff(object):
263 263
         # Setup line width and number width
264 264
         if width <= 0:
265 265
             width = 80
266
-
267 266
         (start, offset) = self._hunks[-1]._old_addr
268 267
         max1 = start + offset - 1
269 268
         (start, offset) = self._hunks[-1]._new_addr
270 269
         max2 = start + offset - 1
271 270
         num_width = max(len(str(max1)), len(str(max2)))
271
+
272
+        # Setup lineno and line format
272 273
         left_num_fmt = colorize('%%(left_num)%ds' % num_width, 'yellow')
273 274
         right_num_fmt = colorize('%%(right_num)%ds' % num_width, 'yellow')
274 275
         line_fmt = left_num_fmt + ' %(left)s ' + COLORS['reset'] + \

+ 1
- 2
tests/test_cdiff.py Vedi File

@@ -393,8 +393,7 @@ class TestMain(unittest.TestCase):
393 393
         self._change_file('read_diff')
394 394
 
395 395
         os.chdir(self._ws)
396
-        #ret = cdiff.main()
397
-        ret = 0
396
+        ret = cdiff.main()
398 397
         os.chdir(self._cwd)
399 398
         self.assertEqual(ret, 0)
400 399