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
outputfile = None
inputfile = None parser = OptionParser(usage="usage: %prog [--gui] [inputfile [outputfile]]")
outputfile = None parser.add_option("", "--gui", dest="display",
display = False action="store_true", default=False,
help="ignore 'outputfile' and show the GUI window")
(options, args) = parser.parse_args()
for arg in sys.argv[1:]: if len(args) > 0:
if arg == "-gui": inputfile = args[0]
display = True if len(args) > 1:
elif arg[0] != '-': outputfile = args[1]
if not inputfile: if len(args) > 2:
inputfile = arg parser.error("too many arguments given (%d instead of %d)" % (len(args), 2))
elif not outputfile:
outputfile = arg gui = SimpleGui()
if not inputfile: if not inputfile:
gui.model = TestModel() gui.model = TestModel()
gui.mainloop() gui.mainloop()
else: else:
gui.open(inputfile) gui.open(inputfile)
if display: if options.display:
gui.mainloop() gui.mainloop()
else: else:
gui.generateToolpath() gui.generateToolpath()
......
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