56 lines
2.0 KiB
Python
56 lines
2.0 KiB
Python
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')
|
|
parser.add_argument('-d', '--database', action='store', default="RD_Bestandspool.csv", help='local filename of the latest fetched RuleDesigner Database')
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
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)
|
|
|
|
|
|
|