IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 99fea3cf authored by ralfulrich's avatar ralfulrich
Browse files

first check, if existing notice is identical to new one

parent 097c01c1
No related branches found
No related tags found
No related merge requests found
...@@ -42,13 +42,23 @@ def checkNote(filename): ...@@ -42,13 +42,23 @@ def checkNote(filename):
endNote = iLine endNote = iLine
iLine += 1 iLine += 1
#if startNote>=0 and endNote>=0 and isCopyright: # now check if copyright notice is already there and identical...
#print filename isSame = True
#for iLine in range(startNote, endNote+1): if startNote>=0 and endNote>=0 and isCopyright:
# print lines[iLine] noteLines = text.split('\n')
for iLine in range(len(noteLines)):
os.rename(filename, filename+".bak") if noteLines[iLine] != lines[startNote+iLine]:
isSame = False
print "not same: " + noteLines[iLine] + " " + lines[startNote+iLine]
# check if notice is the same
if isSame:
return
# add (new) copyright notice here:
os.rename(filename, filename+".bak")
with open(filename, "w") as file: with open(filename, "w") as file:
file.write(text) file.write(text)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment