Test auf invalid Characters implementiert. ERP_Item.ini rausgeschmissen. Sonderzeichen im Configparser nicht einfach zu lesen. FileEncoding war auch nicht utf-8. Eigene Textdatei für Sonderzeichen
This commit is contained in:
@@ -80,13 +80,14 @@ class Environment:
|
||||
self.cfg_dir = os.environ.get('CREMIG_CFG')
|
||||
self.ruledesigner_csv_filename = os.environ.get('RD_DATABASE_NAME')
|
||||
|
||||
def build_gui(model, configs, sivasid, uselocal=True):
|
||||
def build_gui(model, configs, env, sivasid, uselocal=True):
|
||||
root = tk.Tk()
|
||||
#root = ttk.Window()
|
||||
app = App(root)
|
||||
|
||||
controller = Controller(model, app)
|
||||
controller.set_env(configs.get_env())
|
||||
controller.set_env(env)
|
||||
controller.set_config(configs)
|
||||
controller.get_csv_files_of_asm(sivasid, uselocal)
|
||||
|
||||
logic = GuiLogic(model, configs)
|
||||
@@ -111,28 +112,28 @@ if __name__ == '__main__':
|
||||
args = parser.parse_args()
|
||||
|
||||
environment = Environment()
|
||||
output_dir = environment.out_dir
|
||||
|
||||
data_dir = environment.data_dir
|
||||
configs = Configs(environment.cfg_dir)
|
||||
configs.set_env(environment)
|
||||
configs.set_data_dir(data_dir)
|
||||
|
||||
|
||||
model = CadItem()
|
||||
if args.demo:
|
||||
model.from_json(json.loads(demo_data))
|
||||
build_gui(model, configs, "400102196", True)
|
||||
build_gui(model, configs, environment, "400102196", True)
|
||||
|
||||
elif args.sivasid:
|
||||
sivasid = args.sivasid.strip()
|
||||
|
||||
output_dir = environment.out_dir
|
||||
assembl_path = os.path.join(output_dir, sivasid + '.json')
|
||||
if os.path.exists(assembl_path):
|
||||
# wenn schon einmal das assembly als json abgespeichert wurde, dann dieses laden
|
||||
model.load(assembl_path)
|
||||
else:
|
||||
# die Gui aufbauen
|
||||
build_gui(model, configs, sivasid, args.uselocal)
|
||||
build_gui(model, configs, environment, sivasid, args.uselocal)
|
||||
else:
|
||||
parser.print_help()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user