[Zope-Checkins] SVN: Zope/trunk/utilities/fixheaders.py added
Andreas Jung
andreas at andreas-jung.com
Fri Nov 18 09:14:46 EST 2005
Log message for revision 40216:
added
Changed:
A Zope/trunk/utilities/fixheaders.py
-=-
Added: Zope/trunk/utilities/fixheaders.py
===================================================================
--- Zope/trunk/utilities/fixheaders.py 2005-11-18 13:57:56 UTC (rev 40215)
+++ Zope/trunk/utilities/fixheaders.py 2005-11-18 14:14:45 UTC (rev 40216)
@@ -0,0 +1,26 @@
+
+# Script to fix the header files to ZPL 2.1
+
+import os
+
+for dirpath, dirnames, filenames in os.walk('.'):
+
+ for fname in filenames:
+ base,ext = os.path.splitext(fname)
+ if not ext in ('.py', '.c', '.h'): continue
+ fullname = os.path.join(dirpath, fname)
+ if '.svn' in fullname: continue
+ data = open(fullname).read()
+
+ changed = False
+ if 'Version 2.0 (ZPL)' in data:
+ data = data.replace('Version 2.0 (ZPL)', 'Version 2.1 (ZPL)')
+ changed = True
+
+ if '(c) 2002 Zope Corporation' in data:
+ data = data.replace('(c) 2002 Zope Corporation', '(c) 2002 Zope Corporation')
+ changed = True
+
+ print fullname, changed
+ if changed:
+ open(fullname, 'w').write(data)
More information about the Zope-Checkins
mailing list