From d1c3e362a1543c5a4cb6eaf0bfb099f50f4056d1 Mon Sep 17 00:00:00 2001 From: Nicole Borrelli Date: Mon, 3 Jun 2019 10:40:38 +1000 Subject: [PATCH] Don't require lowercase name Forgot that not everyone uses ".gba" (especially Windows users :) --- flask-app.py | 2 +- randomize.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flask-app.py b/flask-app.py index 6d48862..f2a6b5d 100644 --- a/flask-app.py +++ b/flask-app.py @@ -37,7 +37,7 @@ def randomize(): rom = randomize_rom(rom, flags, rom_seed) filename = uploaded_rom.filename - index = filename.rfind(".gba") + index = filename.lower().rfind(".gba") if index < 0: return f"Bad filename: {filename}" filename = get_filename(filename, flags, rom_seed) diff --git a/randomize.py b/randomize.py index fc3fd17..c1999f8 100755 --- a/randomize.py +++ b/randomize.py @@ -158,7 +158,7 @@ def get_filename(base_path: str, flags: Flags, rom_seed: str) -> str: filename = base_path if filename.find(os.sep) > -1: filename = filename[0:filename.rfind(os.sep)] - if filename.endswith(".gba"): + if filename.lower().endswith(".gba"): filename = filename[:len(filename) - 4] return f"{filename}_{flags.text()}_{rom_seed}.gba"