Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions packs/proc/proc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from concurrent.futures import process
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this import is needed is it? :)

import os
import sys
import traceback
Expand All @@ -18,22 +19,20 @@ def proc(config_file):
full_path = os.path.expandvars(config_file)

conf_dict = read_config_file(full_path)
# removing the first two components so that they can be fed into functions
arg_dict = dict(list(conf_dict.items())[2:])

# check the method implemented, currently just process
try:
match conf_dict['process']:
match conf_dict.pop('process'):
case 'decode':
if conf_dict['wavedump_edition'] == 2:
process_bin_WD2(**arg_dict)
elif conf_dict['wavedump_edition'] == 1:
process_bin_WD1(**arg_dict)
else:
raise RuntimeError(f"wavedump edition {conf_dict['wavedump_edition']} decoding isn't currently implemented.")
case default:
raise RuntimeError(f"process {conf_dict['process']} not currently implemented.")
match conf_dict.pop('wavedump_edition'):
case 1:
process_bin_WD1(**conf_dict)
case 2:
process_bin_WD2(**conf_dict)
case other:
raise RuntimeError(f"wavedump edition {other} decoding isn't currently implemented.")
case other:
raise RuntimeError(f"process {other} not currently implemented.")
except KeyError as e:
print(f"\nError in the configuration file, incorrect or missing argument: {e} \n")
traceback.print_exc()
sys.exit(2)
sys.exit(2)