Skip to content

Commit 41a9ecd

Browse files
authored
Still debugging, lint fixes
1 parent f4f19c4 commit 41a9ecd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

data.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,20 @@ def load_textdata(self, scriptname: str) -> Any:
4141
script_dir = get_script_path()
4242
lang_file = script_dir / 'out' / 'raw' / f'{scriptname}.gml'
4343
ret = {}
44-
textdata_regex = re.compile(r"ds_map_add\(global\.text_data_[a-z]+, \"([a-zA-Z0-9_]+)\", ([\"'])(.*)\2\)")
44+
textdata_regex = re.compile(
45+
r"ds_map_add\(global\.text_data_[a-z]+, "
46+
+ r"\"([a-zA-Z0-9_]+)\", ([\"'])(.*)\2\)"
47+
)
4548
with open(lang_file, 'r') as file:
46-
print("Successfully opened", lang_file)
4749
for line in file.readlines():
48-
if not line.startswith("ds_map_add"):
50+
if not line.startswith('ds_map_add'):
4951
continue
50-
line = line.replace("' + \"'\" + '", "'").replace('" + \'"\' + "', '"')
52+
line = line.replace("' + \"'\" + '", "'")
53+
line = line.replace('" + \'"\' + "', '"')
5154
matches = textdata_regex.match(line)
5255
if matches is not None:
5356
ret[matches[1]] = matches[3]
57+
print('Got %d lines' % len(ret))
5458
return ret
5559

5660
def load_enemies(self) -> List[str]:
@@ -68,7 +72,6 @@ def load_sums(self) -> Dict[str, str]:
6872
return self.load_json('sums')
6973

7074
def load_lang(self) -> Dict[str, str]:
71-
print("Game:", self.game)
7275
if self.game == 'undertale':
7376
return self.load_textdata('gml_Script_textdata_en')
7477
return self.load_json('lang_en')

0 commit comments

Comments
 (0)