def main(): tool_db_man = DataBaseManager() try: tooldb_loop() # loop forever, use callbacks except Exception as e: print(f"Exception = {e}", file=sys.stderr) tool_db_man.close()
def main(): build_tool_list() tooldb_tools(TOOLS.keys()) tooldb_callbacks(get_tool, put_tool, load_spindle, unload_spindle) try: tooldb_loop() # loop forever, use callbacks except Exception as e: PLASMADB.terminate() if sys.stdin.isatty(): print(("exception=", e)) else: pass # avoid messages at termination PLASMADB.terminate()
tools[key] = params.upper() # sync to host if debug: sys.stderr.write("@@user_put_tool_nonran_tc: %s\n" % tools[key]) save_tools_to_file(db_savefile) #----------------------------------------------------------- # begin debug = 0 # debug var for command line testing if (len(sys.argv) > 1 and sys.argv[1] == 'debug'): debug = 1 toolno_min = 10 toolno_max = 19 make_tools(toolno_min, toolno_max) if random_toolchanger: tooldb_callbacks(user_get_tool, user_put_tool_ran_tc) else: tooldb_callbacks(user_get_tool, user_put_tool_nonran_tc) toollist = list(range(toolno_min, toolno_max + 1)) if random_toolchanger: toollist.append(0) # T0 provision tooldb_tools(toollist) try: tooldb_loop() # loop forever, use callbacks except Exception as e: if sys.stdin.isatty(): print(("exception=", e)) else: pass # avoid messages at termination