about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-11-25 19:42:40 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-11-25 19:42:40 +0000
commita0e5181e424fa1a320da259203975048e855632c (patch)
treef958dd35ae54164783e662e5480c0261e9d58dc5 /scripts
parente5629675a35fe6fbdbb907a9a0417667ac005b2f (diff)
downloadzcatch-a0e5181e424fa1a320da259203975048e855632c.tar.gz
zcatch-a0e5181e424fa1a320da259203975048e855632c.zip
added license info
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/copyright.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/copyright.py b/scripts/copyright.py
new file mode 100755
index 00000000..051eb4ac
--- /dev/null
+++ b/scripts/copyright.py
@@ -0,0 +1,26 @@
+import sys, os
+
+notice = "/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */\n"
+
+def fix_copyright_notice(filename):
+	f = open(filename, "rb")
+	lines = f.readlines()
+	f.close()
+	
+	if "/*" in lines[0] and "copyright" in lines[0]:
+		lines[0] = notice
+	else:
+		lines = [notice] + lines
+	file(filename, "wb").writelines(lines)
+	
+for root, dirs, files in os.walk("src"):
+    for name in files:
+    	filename = os.path.join(root, name)
+    	process = 0
+    	if ".h" == filename[-2:] or ".c" == filename[-2:] or ".cpp" == filename[-4:]:
+    		process = 1
+    	if os.sep + "external" + os.sep in filename:
+    		process = 0
+    	
+    	if process:
+    		fix_copyright_notice(filename)