Commit e1d5e5da authored by sumpfralle's avatar sumpfralle

fixed some more path issues


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@943 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 6ac64aeb
......@@ -25,13 +25,14 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
# extend the PYTHONPATH to include the "src" directory
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
"src"))
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(BASE_DIR, "src"))
# register the glut32.dll manually for the pyinstaller standalone executable
if hasattr(sys, "frozen") and sys.frozen and "_MEIPASS2" in os.environ:
from ctypes import windll
windll[os.path.join(os.environ["_MEIPASS2"], "glut32.dll")]
windll[os.path.join(os.path.normpath(os.environ["_MEIPASS2"]),
"glut32.dll")]
import pycam.Gui.common as GuiCommon
import pycam.Gui.Settings
......@@ -62,12 +63,13 @@ except ImportError:
log = pycam.Utils.log.get_logger()
EXAMPLE_MODEL_LOCATIONS = [
os.path.join(os.path.dirname(__file__), "samples"),
os.path.join(BASE_DIR, "samples"),
os.path.join(sys.prefix, "share", "pycam", "samples"),
os.path.join("usr", "share", "pycam", "samples")]
# for pyinstaller (windows distribution)
if "_MEIPASS2" in os.environ:
EXAMPLE_MODEL_LOCATIONS.insert(0, os.path.join(os.environ["_MEIPASS2"], "samples"))
EXAMPLE_MODEL_LOCATIONS.insert(0, os.path.join(os.path.normpath(
os.environ["_MEIPASS2"]), "samples"))
DEFAULT_MODEL_FILE = "pycam.stl"
EXIT_CODES = {"ok": 0, "requirements": 1, "load_model_failed": 2,
"write_output_failed": 3, "parsing_failed": 4,
......
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