mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
WIP: Make it work with Python 3.7 packaing
This commit is contained in:
parent
309f90ceb8
commit
b03f666bf5
3 changed files with 20 additions and 4 deletions
|
@ -348,6 +348,9 @@ class CuraApplication(QtApplication):
|
||||||
for dir_name in ["extruders", "machine_instances", "materials", "plugins", "quality", "quality_changes", "user", "variants", "intent"]:
|
for dir_name in ["extruders", "machine_instances", "materials", "plugins", "quality", "quality_changes", "user", "variants", "intent"]:
|
||||||
Resources.addExpectedDirNameInData(dir_name)
|
Resources.addExpectedDirNameInData(dir_name)
|
||||||
|
|
||||||
|
app_root = os.path.abspath(os.path.join(os.path.dirname(sys.executable)))
|
||||||
|
Resources.addSearchPath(os.path.join(app_root, "share", "cura", "resources"))
|
||||||
|
|
||||||
Resources.addSearchPath(os.path.join(self._app_install_dir, "share", "cura", "resources"))
|
Resources.addSearchPath(os.path.join(self._app_install_dir, "share", "cura", "resources"))
|
||||||
if not hasattr(sys, "frozen"):
|
if not hasattr(sys, "frozen"):
|
||||||
resource_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources")
|
resource_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources")
|
||||||
|
|
|
@ -171,6 +171,7 @@ else:
|
||||||
# tries to create PyQt objects on a non-main thread.
|
# tries to create PyQt objects on a non-main thread.
|
||||||
import Arcus #@UnusedImport
|
import Arcus #@UnusedImport
|
||||||
import Savitar #@UnusedImport
|
import Savitar #@UnusedImport
|
||||||
|
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,22 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
if Platform.isWindows():
|
if Platform.isWindows():
|
||||||
executable_name += ".exe"
|
executable_name += ".exe"
|
||||||
default_engine_location = executable_name
|
default_engine_location = executable_name
|
||||||
if os.path.exists(os.path.join(CuraApplication.getInstallPrefix(), "bin", executable_name)):
|
|
||||||
default_engine_location = os.path.join(CuraApplication.getInstallPrefix(), "bin", executable_name)
|
search_path = [
|
||||||
if hasattr(sys, "frozen"):
|
os.path.abspath(os.path.dirname(sys.executable)),
|
||||||
default_engine_location = os.path.join(os.path.dirname(os.path.abspath(sys.executable)), executable_name)
|
os.path.abspath(os.path.join(os.path.dirname(sys.executable), "bin")),
|
||||||
|
os.path.abspath(os.path.join(os.path.dirname(sys.executable), "..")),
|
||||||
|
|
||||||
|
os.path.join(CuraApplication.getInstallPrefix(), "bin"),
|
||||||
|
os.path.dirname(os.path.abspath(sys.executable)),
|
||||||
|
]
|
||||||
|
|
||||||
|
for path in search_path:
|
||||||
|
engine_path = os.path.join(path, executable_name)
|
||||||
|
if os.path.isfile(engine_path):
|
||||||
|
default_engine_location = engine_path
|
||||||
|
break
|
||||||
|
|
||||||
if Platform.isLinux() and not default_engine_location:
|
if Platform.isLinux() and not default_engine_location:
|
||||||
if not os.getenv("PATH"):
|
if not os.getenv("PATH"):
|
||||||
raise OSError("There is something wrong with your Linux installation.")
|
raise OSError("There is something wrong with your Linux installation.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue