diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-12-06 17:36:41 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-12-06 17:36:41 -0600 |
| commit | 39738b84e9164b0f2d01f22440548c4393160013 (patch) | |
| tree | 33bd667664b33263c8f75d96fc243bcbb38ccd25 /manager.py | |
| parent | caf3fb9aeb3ddc8160dc71c9a871cf4d157ff709 (diff) | |
| download | immich-frame-39738b84e9164b0f2d01f22440548c4393160013.tar.xz immich-frame-39738b84e9164b0f2d01f22440548c4393160013.zip | |
port to pygamev0.2.0
Diffstat (limited to 'manager.py')
| -rw-r--r-- | manager.py | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -1,27 +1,14 @@ import os import sys -import signal import copy from threading import Thread from pathlib import Path -from OpenGL.GLUT import glutLeaveMainLoop class PixMan: _instance = None _initialized = False - @staticmethod - def handle_sigint(sig, frame): - try: - # Threads are started as daemons so will automatically shut down - glutLeaveMainLoop() - sys.exit(0) - except: - pass - finally: - print("Exiting...") - def __new__(cls, *args, **kwargs): if cls._instance is None: cls._instance = super().__new__(cls) @@ -48,8 +35,6 @@ class PixMan: self.t_flask = None self.t_idle_download = None - signal.signal(signal.SIGINT, PixMan.handle_sigint) - self.configfile = configfile self.config = Config.load(self.configfile) if os.path.exists(self.configfile) else Config() @@ -76,7 +61,8 @@ class PixMan: # Create display self.display = PixDisplay(self.texture_list) - self.display.main({}) # TODO glut args + self.display.main() + self.die() def update_textures(self): if self.texture_list: @@ -110,6 +96,12 @@ class PixMan: return True + def die(self): + # Join threads and exit + self.t_flask.join() + self.t_idle_download.join() + sys.exit(0) + @property def frozen(self): # For pyinstaller |
