Commit d1cfd3bb authored by sumpfralle's avatar sumpfralle

changed default model to "pycam.stl"


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@398 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 5e3ea06a
...@@ -28,6 +28,12 @@ from optparse import OptionParser ...@@ -28,6 +28,12 @@ from optparse import OptionParser
import sys import sys
import os import os
EXAMPLE_MODEL_LOCATIONS = (
os.path.join(os.path.dirname(__file__), "Samples", "STL"),
"/usr/share/pycam/Samples/STL")
DEFAULT_MODEL_FILE = "pycam.stl"
# check if we were started as a separate program # check if we were started as a separate program
if __name__ == "__main__": if __name__ == "__main__":
inputfile = None inputfile = None
...@@ -119,9 +125,17 @@ if __name__ == "__main__": ...@@ -119,9 +125,17 @@ if __name__ == "__main__":
else: else:
gui = gui_class() gui = gui_class()
# try to load the default model file ("pycam" logo)
if not inputfile: if not inputfile:
from pycam.Importers.TestModel import TestModel for inputdir in EXAMPLE_MODEL_LOCATIONS:
gui.load_model(TestModel()) inputfile = os.path.join(inputdir, DEFAULT_MODEL_FILE)
if os.path.isfile(inputfile):
gui.open(inputfile)
break
else:
# fall back to the simple test model
from pycam.Importers.TestModel import TestModel
gui.load_model(TestModel())
else: else:
gui.open(inputfile) gui.open(inputfile)
# load task settings file # load task settings file
......
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