parent
dd0a4e84e9
commit
815ec85da9
11
Patch.py
11
Patch.py
|
@ -93,19 +93,22 @@ if __name__ == "__main__":
|
|||
address = f"{host}:{options['port']}"
|
||||
ziplock = threading.Lock()
|
||||
print(f"Host for patches to be created is {address}")
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor() as pool:
|
||||
for rom in sys.argv:
|
||||
try:
|
||||
|
||||
if rom.endswith(".sfc"):
|
||||
print(f"Creating patch for {rom}")
|
||||
result = create_patch_file(rom, address)
|
||||
print(f"Created patch {result}")
|
||||
result = pool.submit(create_patch_file, rom, address)
|
||||
result.add_done_callback(lambda task: print(f"Created patch {task.result()}"))
|
||||
|
||||
elif rom.endswith(".bmbp"):
|
||||
print(f"Applying patch {rom}")
|
||||
data, target = create_rom_file(rom)
|
||||
print(f"Created rom {target}.")
|
||||
if 'server' in data:
|
||||
print(f"Host is {data['server']}")
|
||||
|
||||
elif rom.endswith(".zip"):
|
||||
print(f"Updating host in patch files contained in {rom}")
|
||||
|
||||
|
@ -117,7 +120,7 @@ if __name__ == "__main__":
|
|||
zfw.writestr(zfinfo, data)
|
||||
return zfinfo.filename
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor() as pool:
|
||||
|
||||
futures = []
|
||||
with zipfile.ZipFile(rom, "r") as zfr:
|
||||
updated_zip = os.path.splitext(rom)[0] + "_updated.zip"
|
||||
|
|
Loading…
Reference in New Issue