diff licenser/main.py @ 6:0a01ed263c06

add ability to interpolate a single file; should move to makeitso
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 13 Dec 2010 13:26:31 -0800
parents f7d485cedc80
children 697b6f892e12
line wrap: on
line diff
--- a/licenser/main.py	Mon May 10 12:28:59 2010 -0700
+++ b/licenser/main.py	Mon Dec 13 13:26:31 2010 -0800
@@ -101,8 +101,13 @@
 
     variables = license.obtain_variables()
 
-    for directory in args:
-        license.interpolate(directory, variables)
+    for arg in args:
+        if os.path.isdir(arg):
+            license.interpolate(arg, variables)
+        elif os.path.isfile(arg):
+            license.interpolate_file(arg, variables)
+        else:
+            raise IOError("File not found: '%s'" % arg)
 
 if __name__ == '__main__':
     main()