From c10739e70c6dd36506ca47694188a73b9e3be07a Mon Sep 17 00:00:00 2001 From: qadan Date: Sat, 8 Feb 2020 19:17:34 -0400 Subject: [PATCH] fixing up some stuff I broke --- Mystery.py | 7 ++++--- Rom.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Mystery.py b/Mystery.py index ff4410a8..5a47cc9a 100644 --- a/Mystery.py +++ b/Mystery.py @@ -67,7 +67,6 @@ def main(): if path: if path not in weights_cache: weights_cache[path] = get_weights(path) - print(weights_cache[path]) print(f"P{player} Weights: {path} >> {weights_cache[path]['description']}") erargs = parse_arguments(['--multi', str(args.multi)]) @@ -102,8 +101,10 @@ def main(): def get_weights(path): try: - with open(path, 'rb') as f: - yaml = str(f.read(), "utf-8") + parsed_url = urllib.parse.urlparse(path) + if all(parsed_url.scheme, parsed_url.netloc, parsed_url.path): + with open(path, 'rb') as f: + yaml = str(f.read(), "utf-8") except Exception as e: print('Failed to read weights (%s)' % e) return diff --git a/Rom.py b/Rom.py index b5817f24..be8aed8c 100644 --- a/Rom.py +++ b/Rom.py @@ -12,9 +12,9 @@ import subprocess from BaseClasses import CollectionState, ShopType, Region, Location from Dungeons import dungeon_music_addresses from Regions import location_table - from Text import MultiByteTextMapper, CompressedTextMapper, text_addresses, Credits from Text import TextTable, Uncle_texts, Ganon1_texts, TavernMan_texts, Sahasrahla2_texts, Triforce_texts, Blind_texts, BombShop2_texts, junk_texts + from Text import KingsReturn_texts, Sanctuary_texts, Kakariko_texts, Blacksmiths_texts, DeathMountain_texts, LostWoods_texts, WishingWell_texts, DesertPalace_texts, MountainTower_texts, LinksHouse_texts, Lumberjacks_texts, SickKid_texts, FluteBoy_texts, Zora_texts, MagicShop_texts, Sahasrahla_names from Utils import output_path, local_path, int16_as_bytes, int32_as_bytes, snes_to_pc from Items import ItemFactory