Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
|
||||
import re,os,sys
|
||||
|
||||
rx1 = re.compile('(@RDE_HEADER@[ ]*\n[ \*]*)')
|
||||
rx2 = re.compile('(\\$Id: ([^ ]*) ([^ ]*).*)')
|
||||
rx3 = re.compile('.*\\$HeadURL:.*\n')
|
||||
rx4 = re.compile('(\\$Author: ([^ ]*).*)')
|
||||
|
||||
def replace_svn_keywords(filename):
|
||||
print "fixing %s" % filename
|
||||
input_file = open(filename, "r")
|
||||
output = input_file.read()
|
||||
input_file.close()
|
||||
|
||||
output = rx1.sub('\\\\brief ', output)
|
||||
output = rx2.sub('\\\\file \\2\n * \\\\version \\3', output)
|
||||
output = rx3.sub('', output)
|
||||
output = rx4.sub('\\\\author \\2', output)
|
||||
|
||||
output_file = open(filename, "w")
|
||||
output_file.write(output)
|
||||
output_file.close()
|
||||
|
||||
nargs = len(sys.argv)
|
||||
if nargs != 2 or not os.path.isdir(sys.argv[1]):
|
||||
print "usage: %s <src-dir>"
|
||||
sys.exit(1)
|
||||
|
||||
for path, subdirs, files in os.walk(sys.argv[1]):
|
||||
files.extend(subdirs)
|
||||
for name in files:
|
||||
if name.endswith('.c') or \
|
||||
name.endswith('.h') or \
|
||||
name.endswith('.cpp') or \
|
||||
name.endswith('.hpp'):
|
||||
replace_svn_keywords(os.path.join(path, name))
|
||||
Reference in new issue
Block a user