diff --git a/scripts/ids-to-yaml.py b/scripts/ids-to-yaml.py deleted file mode 100755 index 1e1bfd2..0000000 --- a/scripts/ids-to-yaml.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 - -import yaml -import argparse - - -def main(): - parser = argparse.ArgumentParser(description="Convert a list of items into a structured YAML format.") - parser.add_argument("input_file", help="Path to the IDS list.") - parser.add_argument("doc_value", help="IDS filename to display in tooltips") - parser.add_argument("output_file", help="Path to the output YAML file.") - - args = parser.parse_args() - - try: - with open(args.input_file, "r") as file: - lines = file.readlines() - - data = [] - for line in lines: - line = line.strip() - if line: # Skip empty lines - parts = line.split() - if len(parts) == 2: - value, name = parts - data.append({"name": name, "detail": value, "doc": args.doc_value}) - - with open(args.output_file, "w") as file: - yaml.dump(data, file, default_flow_style=False, sort_keys=False) - - print(f"Output written to {args.output_file}") - - except FileNotFoundError: - print(f"File not found: {args.input_file}") - except Exception as e: - print(f"An error occurred: {e}") - - -if __name__ == "__main__": - main() diff --git a/scripts/ids_to_yaml.py b/scripts/ids_to_yaml.py new file mode 100755 index 0000000..405ade2 --- /dev/null +++ b/scripts/ids_to_yaml.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +import argparse +import yaml + + +def main(): + parser = argparse.ArgumentParser(description="Convert a list of items into a structured YAML format.") + parser.add_argument("input_file", help="Path to the IDS list.") + parser.add_argument("doc_value", help="IDS filename to display in tooltips") + parser.add_argument("output_file", help="Path to the output YAML file.") + + args = parser.parse_args() + + with open(args.input_file, "r", encoding="utf-8") as file: + lines = file.readlines() + + data = [] + for line in lines: + line = line.strip() + if line: # Skip empty lines + parts = line.split() + if len(parts) == 2: + value, name = parts + data.append({"name": name, "detail": value, "doc": args.doc_value}) + + with open(args.output_file, "w", encoding="utf-8") as file: + yaml.dump(data, file, default_flow_style=False, sort_keys=False) + + print(f"Output written to {args.output_file}") + + +if __name__ == "__main__": + main() diff --git a/scripts/iesdp_update.py b/scripts/iesdp_update.py index 4d85dfb..18c08c6 100755 --- a/scripts/iesdp_update.py +++ b/scripts/iesdp_update.py @@ -311,7 +311,8 @@ def sanitise(self): definition_items = {**definition_items, **new_definition_items} pod.append_offsets(offsets, prefix) - prefix_dir = get_format_version(ff) + # This is not a constant, and doesn't need UPPERCASE + prefix_dir = get_format_version(ff) # pylint: disable=invalid-name dump_definition(prefix_dir, definition_items, IELIB_STRUCTURES_DIR) # feature block