Pfade und Schalter auf lokale Files berichtigt

This commit is contained in:
2023-10-24 17:01:30 +02:00
parent 966fd8c665
commit 0b89c52a19
+9 -2
View File
@@ -32,16 +32,23 @@ def compareFiles(rdDataBasePath, jsonPath, sivasId, outPath):
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser(description='fetches data from sivas or ruledesigner fusion', prog='update_database') 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('-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() args = parser.parse_args()
dataDir = os.environ.get('CREMIG_DATA')
rdDataBasePath = os.environ.get('RD_DATABASE_SOURCE')
if args.sivas: 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') exePath = os.environ.get('SIVAS_DATABASE_QUERY')
# in case the infos for this cad file are already there
sivasId = str(args.sivas) sivasId = str(args.sivas)
jsonPath = os.path.join(dataDir, sivasId + ".json") jsonPath = os.path.join(dataDir, sivasId + ".json")
# there the results are written
outPath = os.environ.get('CREMIG_WORK') outPath = os.environ.get('CREMIG_WORK')
compareFiles(rdDataBasePath, jsonPath, sivasId, outPath) compareFiles(rdDataBasePath, jsonPath, sivasId, outPath)