diff --git a/scripts/gen_docs.py b/scripts/gen_docs.py index b2a86af3..5e1b5c07 100755 --- a/scripts/gen_docs.py +++ b/scripts/gen_docs.py @@ -102,7 +102,7 @@ def wrap_docs_page(table_content, gen, gen_dir, curr_page, json_file, title, is_ if title is None and gen: title = 'Gen ' + str(gen) + (f' (new sprites only)' if new_sprites_only else '') - + main_info = '''

This table lists all inventory item sprites. These items are from the last several games and is up-to-date as of Pokémon Sword/Shield. The sprites are from Gen 3 through 8.

All sprites are 32×32 in size. There are two sets of sprites: one with a Sword/Shield style white outline around the sprites, and one without (as all previous games). Both sets contain the same number of sprites, and both are listed below.

@@ -206,7 +206,7 @@ def run_cmd(cmd): return subprocess.check_output(cmd, cwd=BASE_DIR).strip().decode('utf-8') def write_file(filename, content): - with open(filename, 'wt') as file: + with open(filename, 'wt', encoding="utf8") as file: print(content, file=file) def docs_url(slug): @@ -236,7 +236,7 @@ def read_repo_state(): def read_json_file(file): '''Reads a single JSON and returns a dict''' - with open(file) as json_file: + with open(file, encoding="utf8") as json_file: return json.load(json_file) def read_data(): @@ -535,7 +535,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', rowspan = f' rowspan="{rows}"' if rows > 1 else '' buffer.append(f'{name_eng.capitalize()}') buffer.append(f'{name_jpn}') - + buffer.append('' + \ f'' + \ get_img_node(get_misc_url(base_url, v), None, f"Sprite for '{name_eng}'", 'm', 'body-style-gen8') + '') @@ -582,7 +582,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', sprites_counter += 1 row_n += 1 buffer.append('') - + # Body styles buffer.append('') buffer.append('%s' % groups['body-style']['name']['eng']) @@ -615,7 +615,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', sprites_counter += 1 row_n += 1 buffer.append('') - + buffer.append('') buffer.append('') buffer.append(''' @@ -657,7 +657,7 @@ def generate_items_table(itm, itm_unl, inv, etc, dirs, curr_page, json_file, ver if not item_dict.get(group): item_dict[group] = [] item_dict[group].append({ 'name': name, 'id': id, 'linked': True }) - + for item, details in itm_unl.items(): group, name = item.split('/') type = { 'name': name, 'id': None, 'linked': False, 'type': details['type'], 'dupe_id': details.get('of', {}).get('item_id') }