summaryrefslogtreecommitdiff
path: root/manager.py
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-06-25 00:17:14 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-06-25 00:17:14 -0500
commitb4c2bf500d1939d93f1c2146798842d5f98902de (patch)
tree9404312ac4cfe2da717bc28fa3cb635b922d27bd /manager.py
parent14eb01ff466ac78b2912d325a45786545d495f45 (diff)
downloadimmich-frame-b4c2bf500d1939d93f1c2146798842d5f98902de.tar.xz
immich-frame-b4c2bf500d1939d93f1c2146798842d5f98902de.zip
pyinstaller support
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