From 29ee4fe3074dddc847768e3ea8365f427bf3b019 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 17 Jun 2020 08:59:50 +0200 Subject: [PATCH] rename baserom to basepatch to make it clearer what it is Also move actual baserom to root folder to make it harder to accidentally share it with others when copying stuff --- Rom.py | 21 +++++++++++---------- data/{baserom.bmbp => basepatch.bmbp} | Bin 2 files changed, 11 insertions(+), 10 deletions(-) rename data/{baserom.bmbp => basepatch.bmbp} (100%) diff --git a/Rom.py b/Rom.py index be1a2ed5..6a72ebe4 100644 --- a/Rom.py +++ b/Rom.py @@ -67,21 +67,22 @@ class LocalRom(object): def patch_base_rom(self): from Patch import create_patch_file, create_rom_bytes - if os.path.isfile(local_path('data/baserom.sfc')): - with open(local_path('data/baserom.sfc'), 'rb') as stream: + if os.path.isfile(local_path('basepatch.sfc')): + with open(local_path('basepatch.sfc'), 'rb') as stream: buffer = bytearray(stream.read()) if self.verify(buffer): self.buffer = buffer - if not os.path.exists(local_path('data/baserom.bmbp')): - create_patch_file(local_path('data/baserom.sfc')) + if not os.path.exists(local_path(os.path.join('data', 'basepatch.bmbp'))): + create_patch_file(local_path('basepatch.sfc')) return - - if os.path.isfile(local_path('data/baserom.bmbp')): - _, target, buffer = create_rom_bytes(local_path('data/baserom.bmbp')) + logging.info(local_path(os.path.join('data', 'basepatch.bmbp'))) + logging.info(os.path.isfile(local_path(os.path.join('data', 'basepatch.bmbp')))) + if os.path.isfile(local_path(os.path.join('data', 'basepatch.bmbp'))): + _, target, buffer = create_rom_bytes(local_path(os.path.join('data', 'basepatch.bmbp'))) if self.verify(buffer): self.buffer = bytearray(buffer) - with open(local_path('data/baserom.sfc'), 'wb') as stream: + with open(local_path('basepatch.sfc'), 'wb') as stream: stream.write(buffer) return @@ -103,9 +104,9 @@ class LocalRom(object): # verify md5 if self.verify(self.buffer): - with open(local_path('data/baserom.sfc'), 'wb') as stream: + with open(local_path('basepatch.sfc'), 'wb') as stream: stream.write(self.buffer) - create_patch_file(local_path('data/baserom.sfc')) + create_patch_file(local_path('basepatch.sfc')) os.remove(local_path('data/base2current.json')) else: raise RuntimeError( diff --git a/data/baserom.bmbp b/data/basepatch.bmbp similarity index 100% rename from data/baserom.bmbp rename to data/basepatch.bmbp