Have release.py update copyrights as well.
[update-copyright.git] / update_copyright.py
index b9348997f420976806c339c35f3e31a737045adf..0a3a281bd878cd543a1fa0834628d9dd5c491cd9 100755 (executable)
@@ -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)