You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Refresh 10
This commit is contained in:
@@ -136,8 +136,8 @@ def main():
|
||||
try:
|
||||
with open(fname, "rb") as f:
|
||||
roms[lang] = f.read()
|
||||
except:
|
||||
print("Failed to open " + fname + ". Please ensure it exists!")
|
||||
except Exception as e:
|
||||
print("Failed to open " + fname + "! " + str(e))
|
||||
sys.exit(1)
|
||||
sha1 = hashlib.sha1(roms[lang]).hexdigest()
|
||||
with open("sm64." + lang + ".sha1", "r") as f:
|
||||
@@ -215,9 +215,11 @@ def main():
|
||||
input = image[pos : pos + size]
|
||||
os.makedirs(os.path.dirname(asset), exist_ok=True)
|
||||
if asset.endswith(".png"):
|
||||
with tempfile.NamedTemporaryFile(prefix="asset") as png_file:
|
||||
png_file = tempfile.NamedTemporaryFile(prefix="asset", delete=False)
|
||||
try:
|
||||
png_file.write(input)
|
||||
png_file.flush()
|
||||
png_file.close()
|
||||
if asset.startswith("textures/skyboxes/") or asset.startswith("levels/ending/cake"):
|
||||
if asset.startswith("textures/skyboxes/"):
|
||||
imagetype = "sky"
|
||||
@@ -253,6 +255,9 @@ def main():
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
finally:
|
||||
png_file.close()
|
||||
remove_file(png_file.name)
|
||||
else:
|
||||
with open(asset, "wb") as f:
|
||||
f.write(input)
|
||||
|
||||
Reference in New Issue
Block a user