diff options
Diffstat (limited to 'manager.py')
| -rw-r--r-- | manager.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |
