From e17cd3d71fd290fdf25a21f2a28e52431e45e828 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 20 Nov 2009 07:57:17 -0500 Subject: [PATCH] Have release.py update copyrights as well. --- update_copyright.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/update_copyright.py b/update_copyright.py index b934899..0a3a281 100755 --- a/update_copyright.py +++ b/update_copyright.py @@ -409,6 +409,19 @@ def update_file(filename, verbose=True): f.write(contents) f.close() +def update_files(files=None): + if files == None or len(files) == 0: + p = Pipe([['grep', '-rc', '# Copyright', '.'], + ['grep', '-v', ':0$'], + ['cut', '-d:', '-f1']]) + assert p.status == 0 + files = p.stdout.rstrip().split('\n') + + for filename in files: + if ignored_file(filename) == True: + continue + update_file(filename) + def test(): import doctest doctest.testmod() @@ -439,16 +452,4 @@ automatically. sys.exit(0) update_authors() - - files = args - if len(files) == 0: - p = Pipe([['grep', '-rc', '# Copyright', '.'], - ['grep', '-v', ':0$'], - ['cut', '-d:', '-f1']]) - assert p.status == 0 - files = p.stdout.rstrip().split('\n') - - for filename in files: - if ignored_file(filename) == True: - continue - update_file(filename) + update_files(files=args) -- 2.26.2