@@ -54,11 +54,10 @@ # custom modules import ahttp import action import logo -import favicon import channels import channels.bookmarks import channels.configwin import channels.streamedit import channels.search @@ -73,11 +72,11 @@ widgets = {} # non-glade widgets (any manually instantiated ones) channels = {} # channel modules features = {} # non-channel plugins working = [] # threads hooks = { - "play": [favicon.download_playing], # observers queue here + "play": [], # observers queue here "record": [], "init": [], "quit": [action.cleanup_tmp_files], "config_load": [], "config_save": [], @@ -120,12 +119,14 @@ [callback(self) for callback in self.hooks["init"]] # display current open channel/notebook tab gui_startup(18/20.0) self.current_channel = self.current_channel_gtk() - try: self.channel().first_show() - except: log.INIT("main.__init__: current_channel.first_show() initialization error") + try: + self.channel().first_show() + except Exception as e: + log.INIT("main.__init__: current_channel.first_show() initialization error:", e) # bind gtk/glade event names to functions gui_startup(19.75/20.0) self.connect_signals({ @@ -295,14 +296,14 @@ #@TODO: should get a wrapper, for HTTP errors, and optionalize bookamrks lambda: ( self.channel().load(category,reload), reload and self.bookmarks.heuristic_update(self.current_channel,category) ) ) # Thread a function, add to worker pool (for utilizing stop button) - def thread(self, target, *args): + def thread(self, target, *args, **kwargs): if conf.nothreads: - return target(*args) - thread = Thread(target=target, args=args) + return target(*args, **kwargs) + thread = Thread(target=target, args=args, kwargs=kwargs) thread.start() self.working.append(thread) # Click in category list @@ -323,12 +324,13 @@ def update_categories(self, widget): Thread(target=self.channel().reload_categories).start() # Menu invocation: refresh favicons for all stations in current streams category def update_favicons(self, widget): - ch = self.channel() - favicon.download_all(entries=ch.stations(), pixstore=[ch._ls, ch._pix_entry, None]) + if "favicon" in self.features: + ch = self.channel() + self.features["favicon"].update_all(entries=ch.stations(), pixstore=[ch._ls, ch._pix_entry, None]) # Save stream to file (.m3u) def save_as(self, widget): row = self.row() default_fn = row["title"] + ".m3u"