Fixes and shieet

This commit is contained in:
2022-12-29 03:36:36 -03:00
parent 8263d09052
commit 80fba5c0e7
2 changed files with 6 additions and 13 deletions

View File

@ -85,7 +85,7 @@ with open('original.csv', 'r', encoding='utf-8') as input_file, \
# Calculate the estimated time remaining to translate the whole file
time_remaining = avrg(times) * (length - i)
print(f'{Fore.RED}Original: {Fore.RESET}{row[0]} | {Fore.GREEN}Translation: {Fore.RESET}{translation}{" "*10}\n{Fore.CYAN}Estimated time remaining: {str(time_remaining).split(".")[0]}', end="\r")
print(f'{Fore.RED}Original: {Fore.RESET}{row[0]} | {Fore.GREEN}Translation: {Fore.RESET}{translation}{" "*10}\n{Fore.CYAN}Estimated time remaining: {str(time_remaining).split(".")[0]} {Fore.YELLOW}({i}/{length})', end="\r")
writer.writerow([row[0], translation])

View File

@ -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