From 966fd8c6654cb3dcc1875fa098e354307d43c438 Mon Sep 17 00:00:00 2001 From: mistangl Date: Thu, 19 Oct 2023 17:59:13 +0200 Subject: [PATCH] =?UTF-8?q?lib=20aus=20.gitignore=20rausgenommen.=20Kommen?= =?UTF-8?q?tare=20von=20compare=5Flists=20noch=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - lib/compare_lists.py | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 lib/compare_lists.py diff --git a/.gitignore b/.gitignore index 5d381cc..7e783a8 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ dist/ downloads/ eggs/ .eggs/ -lib/ lib64/ parts/ sdist/ diff --git a/lib/compare_lists.py b/lib/compare_lists.py new file mode 100644 index 0000000..c630847 --- /dev/null +++ b/lib/compare_lists.py @@ -0,0 +1,48 @@ +import argparse +import os +import pandas +# import configparser +# import json + +""" +Dieses Programm holt sich aus +- RD Fusion eine aktuellen Stand der exisitierenden IDS +- Sivas eine Liste der gewünschten Teile + +""" +def create_excel_export(): + """ exportiert die Nummern der Sivas ID in eine Excel Datei um vorhandene von fehlenden zu unterscheiden """ + # Sortierung Teilenummer Bezeichnung Bestandsabfrage Teile Beurteilung Zusatzbemerkung + # Sortierung: Minus - Separierten "Pfad" dieses Einzelteils im Assembly + # Teilenummer: Sivas Teilenummer + # Bezeichnung: SIVAS Bezeichnung + # Bestandsabfrage: Importieren oder Verfügbar + # die restlichen Spalten bleiben leer + pass + + +def compareFiles(rdDataBasePath, jsonPath, sivasId, outPath): + # Lies die RD Datenbank ein + # hole dir alle Ids aus der Json Datei + # Prüfe das Vorhandensein der JsonIds in der RD Datenbank + # Schreibe eine Exceldatei mit den korrekten Spalten raus + pass + + +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') + + args = parser.parse_args() + + dataDir = os.environ.get('CREMIG_DATA') + rdDataBasePath = os.environ.get('RD_DATABASE_SOURCE') + if args.sivas: + exePath = os.environ.get('SIVAS_DATABASE_QUERY') + sivasId = str(args.sivas) + jsonPath = os.path.join(dataDir, sivasId + ".json") + outPath = os.environ.get('CREMIG_WORK') + compareFiles(rdDataBasePath, jsonPath, sivasId, outPath) + + +