Fixes and shieet
This commit is contained in:
@@ -13,16 +13,13 @@
|
||||
|
||||
from os import listdir
|
||||
|
||||
cont = 0
|
||||
nextOne = False
|
||||
next_One = False
|
||||
OUT = "out"
|
||||
|
||||
for file in listdir(f"files_old"):
|
||||
if file.endswith(".rpy"):
|
||||
with open(f"files_old/{file}",'r', encoding="utf8") as f:
|
||||
linesOne = f.readlines()
|
||||
with open(f"files_old/{file}",'r', encoding="utf8") as f2:
|
||||
with open(f"files_new/{file}",'r', encoding="utf8") as f2:
|
||||
linesTwo = f2.readlines()
|
||||
|
||||
if len(linesOne) == len(linesTwo):
|
||||
@@ -31,19 +28,15 @@ for file in listdir(f"files_old"):
|
||||
if nextOne:
|
||||
fp.write(linesOne[number])
|
||||
nextOne = False
|
||||
elif next_One and number % 2 == 0:
|
||||
fp.write(linesOne[number])
|
||||
next_One = False
|
||||
cont = 0
|
||||
elif line.strip().startswith("#") and number != 0:
|
||||
next_One = True
|
||||
cont += 1
|
||||
fp.write(linesTwo[number])
|
||||
elif line.strip().startswith("old"):
|
||||
nextOne = True
|
||||
fp.write(linesTwo[number])
|
||||
print("nuevo",number)
|
||||
elif number % 6 == 0:
|
||||
fp.write(linesOne[number])
|
||||
else:
|
||||
fp.write(linesTwo[number])
|
||||
print("novo",number,linesTwo[number])
|
||||
else:
|
||||
print(f"ERROR processing {file}. There's a discrepancy in the lines. old: {len(linesOne)} - new: {len(linesTwo)}\n\n")
|
||||
continue
|
||||
|
Reference in New Issue
Block a user