From f8c81ba4824f2d3704a66f8ed773a8c87510d747 Mon Sep 17 00:00:00 2001 From: zrgt Date: Mon, 2 Sep 2024 16:36:13 +0200 Subject: [PATCH] app: lower the suffixes Lower the suffixes to also match the filenames with uppercase suffixes --- server/app/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/app/main.py b/server/app/main.py index 715fa631..c8d60aff 100644 --- a/server/app/main.py +++ b/server/app/main.py @@ -29,13 +29,13 @@ continue print(f"Loading {file}") - if file.suffix == ".json": + if file.suffix.lower() == ".json": with open(file) as f: adapter.json.read_aas_json_file_into(object_store, f) - elif file.suffix == ".xml": + elif file.suffix.lower() == ".xml": with open(file) as f: adapter.xml.read_aas_xml_file_into(object_store, file) - elif file.suffix == ".aasx": + elif file.suffix.lower() == ".aasx": with aasx.AASXReader(file) as reader: reader.read_into(object_store=object_store, file_store=file_store) @@ -44,3 +44,6 @@ else: print(f"STORAGE_TYPE must be either LOCAL_FILE or LOCAL_FILE_READ_ONLY! Current value: {storage_type}", file=sys.stderr) + +# Lower the suffix +# Lower the suffixes to also match the filenames with uppercase suffixes \ No newline at end of file