-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
30 lines (23 loc) · 817 Bytes
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import ModifyConfig
import time
def modifyFileHeader(headerUpdate):
print("Modifying file: " + headerUpdate.filePath + ".")
file = open(headerUpdate.filePath, "r")
lines = file.readlines()
file.close()
before = len(lines)
insertAt = headerUpdate.insertAfter
for line in headerUpdate.linesToInsert:
lines.insert(insertAt, line)
insertAt += 1
print("Adding " + str(len(lines) - before) + " line(s).")
file = open(headerUpdate.filePath, "w")
file.writelines(lines)
print("Modifying file finished.\n")
file.close()
start = time.time()
print("Running HTML Modifier")
headerUpdates = ModifyConfig.parseHeadConfigurationFile()
for update in headerUpdates:
modifyFileHeader(update)
print("Modifying ended in: {0: .3f} s.".format(time.time() - start))