Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Tools/scripts/reindent-rst.py

    r2 r391  
    44# Currently just remove trailing whitespace.
    55
    6 from __future__ import with_statement
    7 import sys, re, shutil
     6import sys
    87
    9 ws_re = re.compile(r'\s+(\r?\n)$')
     8import patchcheck
    109
    1110def main(argv=sys.argv):
    12     rv = 0
    13     for filename in argv[1:]:
    14         try:
    15             with open(filename, 'rb') as f:
    16                 lines = f.readlines()
    17             new_lines = [ws_re.sub(r'\1', line) for line in lines]
    18             if new_lines != lines:
    19                 print 'Fixing %s...' % filename
    20             shutil.copyfile(filename, filename + '.bak')
    21             with open(filename, 'wb') as f:
    22                 f.writelines(new_lines)
    23         except Exception, err:
    24             print 'Cannot fix %s: %s' % (filename, err)
    25             rv = 1
    26     return rv
     11    patchcheck.normalize_docs_whitespace(argv[1:])
    2712
    2813if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.