Converted tabs to spaces

This commit is contained in:
ppoelzl
2020-02-10 16:32:50 +01:00
parent 1fcdcba8a4
commit a704c887b2

View File

@@ -4,26 +4,26 @@ import xml.etree.ElementTree
def update_manifest():
manifest = xml.etree.ElementTree.parse("manifest.xml")
root = manifest.getroot()
manifest = xml.etree.ElementTree.parse("manifest.xml")
root = manifest.getroot()
for file in root.iter("File"):
path = file.get('name')
extension = os.path.splitext(path)[1]
if extension not in [".lua", ".txt"]:
print(f"Skipping file type {extension}")
continue
try:
with open(path, 'rb') as f:
data = f.read()
sha1_hash = hashlib.sha1(data).hexdigest()
file.set("sha1", sha1_hash)
print(f"Path: {path} hash: {sha1_hash}")
except FileNotFoundError:
print(f"File not found, skipping {path}")
for file in root.iter("File"):
path = file.get('name')
extension = os.path.splitext(path)[1]
if extension not in [".lua", ".txt"]:
print(f"Skipping file type {extension}")
continue
try:
with open(path, 'rb') as f:
data = f.read()
sha1_hash = hashlib.sha1(data).hexdigest()
file.set("sha1", sha1_hash)
print(f"Path: {path} hash: {sha1_hash}")
except FileNotFoundError:
print(f"File not found, skipping {path}")
manifest.write("manifest-updated.xml")
manifest.write("manifest-updated.xml")
if __name__ == "__main__":
update_manifest()
update_manifest()