From 0b89c52a1963193b9eca901c57691a6d16e9bd41 Mon Sep 17 00:00:00 2001 From: mistangl Date: Tue, 24 Oct 2023 17:01:30 +0200 Subject: [PATCH] Pfade und Schalter auf lokale Files berichtigt --- lib/compare_lists.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/compare_lists.py b/lib/compare_lists.py index c630847..516cfb8 100644 --- a/lib/compare_lists.py +++ b/lib/compare_lists.py @@ -32,16 +32,23 @@ def compareFiles(rdDataBasePath, jsonPath, sivasId, outPath): if __name__ == '__main__': parser = argparse.ArgumentParser(description='fetches data from sivas or ruledesigner fusion', prog='update_database') parser.add_argument('-s', '--sivas', action='store', help='fetch data of this id from sivas fo local database folder') + parser.add_argument('-d', '--database', action='store', default="RD_Bestandspool.csv", help='local filename of the latest fetched RuleDesigner Database') args = parser.parse_args() - dataDir = os.environ.get('CREMIG_DATA') - rdDataBasePath = os.environ.get('RD_DATABASE_SOURCE') + if args.sivas: + # fetching the names of all existing cad files from the local file + dataDir = os.environ.get('CREMIG_DATA') + rdDataBasePath = os.path.join(dataDir, args.database) + # get the path to ask for further json files exePath = os.environ.get('SIVAS_DATABASE_QUERY') + # in case the infos for this cad file are already there sivasId = str(args.sivas) jsonPath = os.path.join(dataDir, sivasId + ".json") + # there the results are written outPath = os.environ.get('CREMIG_WORK') + compareFiles(rdDataBasePath, jsonPath, sivasId, outPath)