Formatting

This commit is contained in:
DazedAnon 2025-01-27 09:03:33 -06:00
parent 1e08fe1c89
commit c30c3f73da
4 changed files with 14 additions and 11 deletions

View file

@ -190,7 +190,10 @@ def parseCSV(readFile, writeFile, filename):
reader = csv.reader(readFile, delimiter=",")
if not ESTIMATE:
writer = csv.writer(writeFile, delimiter=",", )
writer = csv.writer(
writeFile,
delimiter=",",
)
else:
writer = ""

View file

@ -38,7 +38,7 @@ ESTIMATE = ""
TOKENS = [0, 0]
NAMESLIST = []
FIRSTLINESPEAKERS = False # If 1st line of dialogue is a speaker, set to True
FACENAME101 = False # Find Speakers in 101 Codes based on Face Name
FACENAME101 = False # Find Speakers in 101 Codes based on Face Name
NAMES = False # Output a list of all the character names found
BRFLAG = False # If the game uses <br> instead
FIXTEXTWRAP = True # Overwrites textwrap
@ -878,7 +878,7 @@ def searchCodes(page, pbar, jobList, filename):
if len(codeList[i]["parameters"]) > 0:
jaString = codeList[i]["parameters"][0]
# Check if there is text to translate
if not re.search(r'\w+', jaString):
if not re.search(r"\w+", jaString):
i += 1
continue
oldjaString = jaString
@ -1295,7 +1295,7 @@ def searchCodes(page, pbar, jobList, filename):
# continue
# Remove any textwrap & TL
jaString = jaString.replace('\\n', ' ')
jaString = jaString.replace("\\n", " ")
if acExist:
jaString = jaString.replace("\\ac ", " ")
jaString = jaString.replace("\\ac", "")
@ -1318,7 +1318,7 @@ def searchCodes(page, pbar, jobList, filename):
# Textwrap
translatedText = textwrap.fill(translatedText, 80)
translatedText = translatedText.replace('\n', '\\n')
translatedText = translatedText.replace("\n", "\\n")
translatedText = re.sub(r"[\\]+c", r"\\\\c", translatedText)
translatedText = re.sub(r"[\\]+\*item", r"\\\\*item", translatedText)
@ -1345,7 +1345,7 @@ def searchCodes(page, pbar, jobList, filename):
"_TMLogWindowMZ": ("text", None),
"TorigoyaMZ_NotifyMessage": ("message", None),
"SoR_GabWindow": ("arg1", None),
"DarkPlasma_CharacterText": ("text", None)
"DarkPlasma_CharacterText": ("text", None),
}
for key, (argVar, font) in headerMappings.items():

View file

@ -230,7 +230,7 @@ def translatePlugin(data, pbar, filename, translatedList):
# Set to None if empty list
if len(translatedList) <= 0:
translatedList = None
translatedList = None
# Replace Single Quotes
translatedText = re.sub(r"([^\\'])'", r"\1\\'", translatedText)
@ -538,7 +538,7 @@ def translatePlugin(data, pbar, filename, translatedList):
with LOCK:
if filename not in MISMATCH:
MISMATCH.append(filename)
# Custom
if custom:
# Set Progress
@ -552,7 +552,7 @@ def translatePlugin(data, pbar, filename, translatedList):
tokens[1] += response[1][1]
customResponse = response[0]
pbar.update(len(custom))
# Check Mismatch
if len(custom) == len(customResponse):
customTL = customResponse

View file

@ -831,8 +831,8 @@ def searchDB(events, pbar, jobList, filename):
for jaString in jaStringList:
# Pass 1 (Grab Data)
if setData == False:
jaString = jaString.replace('\n', ' ')
jaString = jaString.replace('\r', '')
jaString = jaString.replace("\n", " ")
jaString = jaString.replace("\r", "")
scenarioList[0].append(jaString)
# Pass 2 (Set Data)