Refactored variable. (#190)

From comment in https://github.com/DavidSM64/Diddy-Kong-Racing/pull/189.
This commit is contained in:
AntonioCastelli
2021-12-10 07:29:33 -05:00
committed by GitHub
parent 0344c70892
commit 5cb7b02102
+5 -4
View File
@@ -228,11 +228,12 @@ class GenerateLD:
files.sort(key = lambda x: (x[2], x[3])) # Sort tuples by RAM address and prioritize src files first.
return files
if not os.path.exists('./dkr.ld') and os.path.exists('./assets/' + VERSION + '/md5.txt'):
os.remove('./assets/' + VERSION + '/md5.txt')
checksum_file = './assets/' + VERSION + '/md5.txt'
if not os.path.exists('./dkr.ld') and os.path.exists(checksum_file):
os.remove(checksum_file)
if os.path.exists('./assets/' + VERSION + '/md5.txt'):
with open('./assets/' + VERSION + '/md5.txt', "rt") as a_file:
if os.path.exists(checksum_file):
with open(checksum_file, "rt") as a_file:
with open('./assets/' + VERSION + '/assets.json',"rb") as f:
bytes = f.read() # read file as bytes
readable_hash = hashlib.md5(bytes).hexdigest();