6 exclude_folders = [
"lib",
"bin",
"build",
"qpoases",
"templates"]
9 utfstr = chr(0xef) + chr(0xbb) + chr(0xbf)
10 fdata = file(filename,
"r+").read()
13 if (fdata.startswith(utfstr)):
17 if fdata.startswith(
"/*" ):
21 fdata = fdata[fdata.find(
"*/" ) + 2:]
24 ndata = copyright[:-1] + fdata
26 print "Updating: " + filename
28 file(filename,
"w").write(utfstr + ndata)
30 file(filename,
"w").write(ndata)
33 global exclude_folders
36 fullfn = os.path.join(dir, fn)
37 if (os.path.isdir(fullfn)):
38 if (os.path.basename( fullfn )
in exclude_folders):
42 if (fullfn.endswith(
".cpp")
or fullfn.endswith(
".hpp")
or fullfn.endswith(
".ipp")):
46 copyright = file(
"license_header_cpp.txt",
"r+").read() % datetime.datetime.today().year
48 folders = [
"../include",
50 "../external_packages/include",
51 "../external_packages/src",