Big Chungus has been Introduced
This commit is contained in:
parent
ddf74dfdde
commit
7b4760a163
2018 changed files with 8121 additions and 1 deletions
33
Allfixer.py
Normal file
33
Allfixer.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import os
|
||||
|
||||
# assign directory
|
||||
directory = './history/states'
|
||||
amount = 3000
|
||||
# iterate over files in
|
||||
# that directory
|
||||
for filename in os.scandir(directory):
|
||||
if filename.is_file() and amount != 0:
|
||||
amount -= 1
|
||||
file = open(filename, "r")
|
||||
content = file.read()
|
||||
if not "history" in content:
|
||||
content_split = content.split("\n")
|
||||
if content_split[-1] == "}":
|
||||
content_split[-1] = "\thistory={"
|
||||
content_split.append("\t\tadd_core_of = ABC")
|
||||
elif content_split[-2] == "}":
|
||||
content_split[-2] = "\thistory={"
|
||||
content_split[-1] = ("\t\tadd_core_of = ABC")
|
||||
content_split.append("\t\towner = ABC")
|
||||
content_split.append("\t}")
|
||||
content_split.append("}")
|
||||
print(content, content_split)
|
||||
print("\n\n")
|
||||
file.close()
|
||||
file = open(filename, "w")
|
||||
file.write("")
|
||||
file.close()
|
||||
file = open(filename, "a")
|
||||
for x in content_split:
|
||||
file.write(f"{x}\n")
|
||||
file.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue