[olympic/util] Cleanup
All checks were successful
Build / build (push) Successful in 1m17s

This commit is contained in:
Gary Talent 2025-04-20 21:44:36 -05:00
parent c0bac696dc
commit 4770bb6a93

View File

@ -28,10 +28,7 @@ def file_to_hex(path: str, line_prefix: str) -> tuple[str, int]:
i = 1 i = 1
for b in data: for b in data:
out += f"{b:#0{4}x}," out += f"{b:#0{4}x},"
if i % 10 == 0: out += '\n\t' if i % 10 == 0 else ' '
out += '\n\t'
else:
out += ' '
i += 1 i += 1
return out[:-1], len(data) return out[:-1], len(data)
@ -50,14 +47,8 @@ def proc_rsrc_file(rsrc_path: str):# Open and read the JSON file
with open(rsrc_path, 'r') as file: with open(rsrc_path, 'r') as file:
data = json.load(file) data = json.load(file)
base_path = pathlib.Path(rsrc_path).parent.absolute() base_path = pathlib.Path(rsrc_path).parent.absolute()
if 'all_files' in data: all_files = data['all_files'] if 'all_files' in data else None
all_files = data['all_files'] namespace = data['namespace'] if 'namespace' in data else ''
else:
all_files = None
if 'namespace' in data:
namespace = data['namespace']
else:
namespace = ''
if len(namespace) > 0: if len(namespace) > 0:
push_ns = f'namespace {namespace} {{\n' push_ns = f'namespace {namespace} {{\n'
pop_ns = '\n}\n' pop_ns = '\n}\n'