summaryrefslogtreecommitdiff
path: root/manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'manager.py')
-rw-r--r--manager.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/manager.py b/manager.py
index 6a6498e..275e6b2 100644
--- a/manager.py
+++ b/manager.py
@@ -3,6 +3,7 @@ import sys
import signal
import copy
from threading import Thread
+from pathlib import Path
from OpenGL.GLUT import glutLeaveMainLoop
@@ -109,6 +110,26 @@ class PixMan:
return True
+ @property
+ def frozen(self):
+ # For pyinstaller
+ # https://api.arcade.academy/en/latest/tutorials/bundling_with_pyinstaller/index.html#handling-data-files
+ if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
+ return True
+ return False
+
+ @property
+ def static_dir(self):
+ if self.frozen:
+ return Path(sys._MEIPASS) / "static"
+ return Path("./static/dist")
+
+ @property
+ def static_public(self):
+ if self.frozen:
+ return Path(sys._MEIPASS) / "public"
+ return Path("./static/public")
+
from lazycachelist import LazyCachingTextureList
from window import PixDisplay