Programm-exits eingebaut, da ohne Behebung der aufgeführten Fehlermeldungen eine Weiterführung des Programms nicht zielführend ist, bzw. beim Versuch, die Funktionen get_sivas_dbase und get_rd_dbase automatisiert aufzurufen ansonsten ggf. Rekursionsprobleme auftreten
This commit is contained in:
+11
-6
@@ -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__':
|
||||
|
||||
Reference in New Issue
Block a user