Commit e4efcf24 authored by lode_leroy's avatar lode_leroy
parent 971b6b2d
#!/usr/bin/python #!/usr/bin/python
import sys
import os from optparse import OptionParser
from pycam.Gui.SimpleGui import SimpleGui from pycam.Gui.SimpleGui import SimpleGui
from pycam.Importers.TestModel import TestModel from pycam.Importers.TestModel import TestModel
gui = SimpleGui() # check if we were started as a separate program
if __name__ == "__main__":
inputfile = None inputfile = None
outputfile = None outputfile = None
display = False
parser = OptionParser(usage="usage: %prog [--gui] [inputfile [outputfile]]")
for arg in sys.argv[1:]: parser.add_option("", "--gui", dest="display",
if arg == "-gui": action="store_true", default=False,
display = True help="ignore 'outputfile' and show the GUI window")
elif arg[0] != '-': (options, args) = parser.parse_args()
if not inputfile:
inputfile = arg if len(args) > 0:
elif not outputfile: inputfile = args[0]
outputfile = arg if len(args) > 1:
outputfile = args[1]
if not inputfile: if len(args) > 2:
gui.model = TestModel() parser.error("too many arguments given (%d instead of %d)" % (len(args), 2))
gui.mainloop()
else: gui = SimpleGui()
gui.open(inputfile)
if display: if not inputfile:
gui.model = TestModel()
gui.mainloop() gui.mainloop()
else: else:
gui.generateToolpath() gui.open(inputfile)
if outputfile: if options.display:
gui.save(outputfile) gui.mainloop()
else:
gui.generateToolpath()
if outputfile:
gui.save(outputfile)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment