diff options
| author | Barry Warsaw | 2010-01-01 00:15:27 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2010-01-01 00:15:27 -0500 |
| commit | 721ea276d6126ab611f52292f7b8646425d7e113 (patch) | |
| tree | 9c248072713f6e7b6d5d6e20b808a5f7a84d2d57 /copybump.py | |
| parent | c7074204018693425a1ba9de5129b374d918d8c6 (diff) | |
| download | mailman-721ea276d6126ab611f52292f7b8646425d7e113.tar.gz mailman-721ea276d6126ab611f52292f7b8646425d7e113.tar.zst mailman-721ea276d6126ab611f52292f7b8646425d7e113.zip | |
Diffstat (limited to 'copybump.py')
| -rwxr-xr-x | copybump.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/copybump.py b/copybump.py index 0b9bdf6b9..83f0364c0 100755 --- a/copybump.py +++ b/copybump.py @@ -11,6 +11,7 @@ pyre = re.compile(r'^# Copyright (C) (?P<start>\d{4}-)?(?P<end>\d{4})') def do_file(path): + print('=>', path) with open(path) as in_file, open(path + '.out', 'w') as out_file: for line in in_file: mo = pyre.match(line) @@ -25,3 +26,32 @@ def do_file(path): for line in in_file: out_file.write(line) os.rename(path + '.out', path) + + +def do_walk(): + for root, dirs, files in os.walk('.'): + if root == '.': + dirs.remove('.bzr') + dirs.remove('bin') + dirs.remove('contrib') + dirs.remove('develop-eggs') + dirs.remove('eggs') + dirs.remove('parts') + files.remove('gnu-COPYING-GPL') + files.remove('.installed.cfg') + files.remove('.bzrignore') + files.remove('distribute_setup.py') + if root == './src': + dirs.remove('mailman.egg-info') + if root == './src/mailman': + dirs.remove('messages') + for file_name in files: + if os.path.splitext(file_name)[1] in ('.pyc', '.gz', '.egg'): + continue + path = os.path.join(root, file_name) + if os.path.isfile(path): + do_file(path) + + +if __name__ == '__main__': + do_walk() |
