Browse Source

revert debug code; clean up

Matthew Wang 11 years ago
parent
commit
8f1aa45c8b
2 changed files with 3 additions and 3 deletions
  1. 2
    1
      cdiff.py
  2. 1
    2
      tests/test_cdiff.py

+ 2
- 1
cdiff.py View File

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

+ 1
- 2
tests/test_cdiff.py View File

393
         self._change_file('read_diff')
393
         self._change_file('read_diff')
394
 
394
 
395
         os.chdir(self._ws)
395
         os.chdir(self._ws)
396
-        #ret = cdiff.main()
397
-        ret = 0
396
+        ret = cdiff.main()
398
         os.chdir(self._cwd)
397
         os.chdir(self._cwd)
399
         self.assertEqual(ret, 0)
398
         self.assertEqual(ret, 0)
400
 
399