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)