def main():
if len(sys.argv) < 2:
# GUI mode
gui = GUI()
gui.show_gui()
else:
parser = argparse.ArgumentParser()
parser.add_argument("file", help="Path to g-code file to process")
parser.add_argument("hw_config", help="Extruder/hotend configuration", choices=HW_CONFIGS)
parser.add_argument("--debug", help="Show debug prints", action="store_true")
parser.add_argument("--lines", help="Purge lines to print after filament change", type=int,
default=LINE_COUNT_DEFAULT)
parser.add_argument("--position", help="Purge tower position. Default Auto. Auto will try to find a position with enough free space for the tower",
choices=TOWER_POSITIONS, default=AUTO)
args = parser.parse_args()
options = Settings()
options.hw_config = args.hw_config
options.purge_lines = args.lines
options.tower_position = args.position
log = Logger(prog_dir, gui=False, debug=args.debug)
print_type = detect_file_type(args.file, log)
pf = print_type(log, options)
result_file = pf.process(args.file)
log.info("New file saved: %s" % result_file)
评论列表
文章目录