diff --git a/lib/CreoMigrateGui.py b/lib/CreoMigrateGui.py index c18c88d..72383ab 100644 --- a/lib/CreoMigrateGui.py +++ b/lib/CreoMigrateGui.py @@ -86,7 +86,7 @@ def build_gui(model, configs): app = App(root, configs) controller = Controller(model, app) - logic = GuiLogic(configs) + logic = GuiLogic(model, configs) controller.add_logic(logic) # um ohne Observer pattern auch Rückmeldungen geben zu können diff --git a/lib/get_sivas_teilestamm.py b/lib/get_sivas_teilestamm.py index bf53a22..9efb0d8 100644 --- a/lib/get_sivas_teilestamm.py +++ b/lib/get_sivas_teilestamm.py @@ -10,15 +10,22 @@ Dieses Programm: def get_sivas_teilestamm(sivas_id, out_dir): + sivas_id = sivas_id.strip() sivas_teilestamm_exe = os.environ.get('SIVAS_TEILESTAMM') if os.path.isfile(sivas_teilestamm_exe): if os.path.isdir(out_dir): print(f"Attempting to generate a json-file of all parts to be migrated in relation with '{sivas_id}'") + source_path = os.path.join(os.path.expandvars("%USERPROFILE%"), "AppData", "Local", "Temp", "from_siv.csv") + to_path = os.path.join(out_dir, sivas_id + ".csv") + if os.path.isfile(os.path.join(source_path)): + print("file already there. done") + exit + subprocess.run(f"{sivas_teilestamm_exe} userid=sivas password=forte database=sivas program=ExcelUeb LFDNR=500 EINSTIEG=SQL PARAMETER1={sivas_id}") - - if os.path.isfile(os.path.join(out_dir, sivas_id + ".csv")): + if os.path.isfile(os.path.join(source_path)): + shutil.move(source_path, to_path) print("done") else: print(f"Failure - Couldn't generate {sivas_id}.json. Check for any spelling/typing errors. Otherwise given number is a part without a BOM.")