From 3ad27bf084d9ad7ce733250f064b4db8164b4c83 Mon Sep 17 00:00:00 2001 From: "s.steuer" Date: Mon, 8 Jan 2024 11:00:38 +0100 Subject: [PATCH] =?UTF-8?q?Programm-exits=20eingebaut,=20da=20ohne=20Beheb?= =?UTF-8?q?ung=20der=20aufgef=C3=BChrten=20Fehlermeldungen=20eine=20Weiter?= =?UTF-8?q?f=C3=BChrung=20des=20Programms=20nicht=20zielf=C3=BChrend=20ist?= =?UTF-8?q?,=20bzw.=20beim=20Versuch,=20die=20Funktionen=20get=5Fsivas=5Fd?= =?UTF-8?q?base=20und=20get=5Frd=5Fdbase=20automatisiert=20aufzurufen=20an?= =?UTF-8?q?sonsten=20ggf.=20Rekursionsprobleme=20auftreten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/update_database.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/update_database.py b/lib/update_database.py index 61a4048..3ec2ea4 100644 --- a/lib/update_database.py +++ b/lib/update_database.py @@ -1,8 +1,9 @@ import argparse +import configparser import os import shutil import subprocess -import configparser +import sys """ Dieses Programm: @@ -52,9 +53,11 @@ def get_rd_dbase(out_dir): shutil.copyfile(csv_source_path, csv_destiny_path) print("done") else: - print(f"Can't copy RuleDesigner-database, because output directory ${out_dir} doesn't exist. Check path of %CREMIG_DATA% in cremig_setenv.bat") + print(f"Can't copy RuleDesigner-database, because output directory ${out_dir} doesn't exist. Check %CREMIG_DATA% in cremig_setenv.bat") + sys.exit(0) else: - print(f"no such file ${rd_csv_source_dir} of environment variable RD_DATABASE_SOURCE. Check cremig_setenv.bat") + print(f"File with ruldesigner-partnumbers ${csv_source_path} doesn't exist. Check VPN connection and %RD_DATABASE_SOURCE% + %RD_DATABASE_NAME% in cremig_setenv.bat") + sys.exit(0) def get_sivas_dbase(sivas_id, out_dir): @@ -70,11 +73,13 @@ def get_sivas_dbase(sivas_id, out_dir): 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.") - exit() + sys.exit(0) else: - print(f"'Output directory for .json-file {out_dir}' doesn't exist.") + print(f"'Output directory for .json-file {out_dir}' doesn't exist. Check cremig_setenv.bat or VPN connection.") + sys.exit(0) else: - print(f"Can't execute SIVAS-database query. Check if you have established a VPN connection to the company's network and check the path of %SIVAS_DATABASE_QUERY% in cremig_setenv.bat") + print(f"Can't execute SIVAS-database query. Check VPN connection and check the path of %SIVAS_DATABASE_QUERY% in cremig_setenv.bat") + sys.exit(0) if __name__ == '__main__':