diff options
Diffstat (limited to 'manager.py')
| -rw-r--r-- | manager.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,6 +1,7 @@ import os import sys import signal +import copy from threading import Thread from OpenGL.GLUT import glutLeaveMainLoop @@ -49,10 +50,10 @@ class PixMan: signal.signal(signal.SIGINT, PixMan.handle_sigint) self.configfile = configfile - config = Config.load(self.configfile) if os.path.exists(self.configfile) else Config() + self.config = Config.load(self.configfile) if os.path.exists(self.configfile) else Config() self.init_web(host, port) - self.update_config(config, replace=True) + self.update_config(self.config, replace=True) def init_web(self, host, port): self.t_flask = Thread(target=self.app.run, kwargs={ "host": host, "port": port }) @@ -67,7 +68,7 @@ class PixMan: # Initialize texture list change_callback = lambda d: self.socketio.emit("seek", d) - album_keys = [ "38617851-6b57-44f1-b5f7-82577606afc4" ] + album_keys = [ ] self.texture_list = LazyCachingTextureList(album_keys, max_cache_items=self.config.max_cache_assets, change_callback=change_callback) # Begin downloading images @@ -79,6 +80,7 @@ class PixMan: self.display.main({}) # TODO glut args def update_config(self, config, replace=False): + oldconfig = copy.deepcopy(self.config) if replace: self.config = config else: @@ -90,6 +92,10 @@ class PixMan: self.display.update_config() + if oldconfig.album_list != self.config.album_list: + self.texture_list = LazyCachingTextureList(album_keys) + self.display.update_textures() + # If all goes well self.config.save(self.configfile) return True |
