Index: channels/__init__.py ================================================================== --- channels/__init__.py +++ channels/__init__.py @@ -200,12 +200,12 @@ # Updates gtk_list store, set icon in current display. # Since it is used by bookmarks, would be reshown with next display() anyhow, # and there's no need to invalidate the ls cache, because that's referenced by model anyhow. (model,iter) = self.model_iter() model.set_value(iter, 0, gtkIcon) - except: - pass + except Exception as e: + log.ERR_UIKIT("Couldn't set row_icon()", e) #------------------------ base implementations ----------------------------- Index: channels/links.py ================================================================== --- channels/links.py +++ channels/links.py @@ -76,21 +76,24 @@ parent.hooks["init"].append(self.populate) def populate(self, parent): - # collect links from channel plugins + # Collect links from channel plugins for name,channel in parent.channels.items(): - try: - self.streams.append({ - "favourite": 1, - "genre": "channel", - "title": channel.meta.get("title", channel.module), - "homepage": channel.meta.get("url", ""), - "type": "text/html", - }) - except: pass + try: + self.streams.append({ + "favourite": 1, + "genre": "channel", + "title": channel.meta.get("title", channel.module), + "homepage": channel.meta.get("url", ""), + "type": "text/html", + }) + except Exception as e: + log.ERR("links: adding entry failed:", e) + + # Add built-in link list for row in self.default: (genre, title, homepage) = row self.streams.append({ "genre": genre, "title": title, Index: channels/radiotray.py ================================================================== --- channels/radiotray.py +++ channels/radiotray.py @@ -89,12 +89,12 @@ "genre": group.attrib["name"], "title": bookmark.attrib["name"], "url": bookmark.attrib["url"], "playing": "", }) - except: - pass + except Exception as e: + log.DATA("Extracting from radiotray bookmarks.xml failed:", e) return r # send to def share(self, *w): Index: channels/search.py ================================================================== --- channels/search.py +++ channels/search.py @@ -107,10 +107,11 @@ add = cn.update_streams(cat=None, search=self.q) for row in add: row["genre"] = cn.meta["title"] + " " + row.get("genre", "") entries += add except: + log.WARN("server_search: update_streams error in {}:".format(cn.module), e) continue #main.status(main, 1.0 * i / 15) uikit.do(self.show_results, entries) Index: favicon.py ================================================================== --- favicon.py +++ favicon.py @@ -262,11 +262,11 @@ # convert .ico file to .png format def ico2png(ico, png_fn): image = Image.open(ico) - log.ICO2PNG(ico, png, image) + log.FAVICON_ICO2PNG(ico, png, image) # resize if image.size[0] > 16: image.resize((16, 16), Image.ANTIALIAS) # .png format image.save(png_fn, "PNG", quality=98) Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -364,21 +364,20 @@ def status(self, text=None, timeout=3): self.status_last = time.time() + timeout # progressbar if isinstance(text, (int, float)): - log.FLOAT(text) if (text <= 0): # unknown state uikit.do(self.progress.pulse, immediate=1) elif text >= 0.999 or text < 0.0: # completed uikit.do(self.progress.hide) else: # show percentage uikit.do(self.progress.show, immediate=1) uikit.do(self.progress.set_fraction, text, immediate=1) # add text - elif isinstance(text, (str, unicode)): + elif isinstance(text, (str)): uikit.do(self.statusbar.set_text, text) # timeout if not text or time.time() >= self.status_last: self.statusbar.set_text("") @@ -432,17 +431,17 @@ def init_app_state(self): winlayout = conf.load("window") if (winlayout): try: uikit.app_restore(self, winlayout) - except Exception as e: log.APPRESTORE(e) # may fail for disabled/reordered plugin channels + except Exception as e: log.APPSTATE_RESTORE(e) # may fail for disabled/reordered plugin channels winstate = conf.load("state") if (winstate): for id,prev in winstate.items(): try: self.channels[id].current = prev["current"] - except Exception as e: log.APPSTATE(e) + except Exception as e: log.APPSTATE_RESTORE(e) # store window/widget states (sizes, selections, etc.) def save_app_state(self, widget): # gtk widget states widgetnames = ["win_streamtuner2", "toolbar", "notebook_channels", ] \ @@ -461,11 +460,11 @@ def gtk_main_quit(self, widget, *x): if conf.auto_save_appstate: try: # doesn't work with gtk3 yet (probably just hooking at the wrong time) self.save_app_state(widget) except Exception as e: - log.ERR(e) + log.ERR("st2.gtk_main_quit", e) gtk.main_quit() # Right clicking a stream/station in the treeview to make context menu pop out. def station_context_menu(self, treeview, event): Index: uikit.py ================================================================== --- uikit.py +++ uikit.py @@ -666,11 +666,12 @@ progressbar.set_fraction(p) progressbar.set_property("text", msg) while gtk.events_pending(): gtk.main_iteration(False) else: progresswin.hide() - except: return + except Exception as e: + log.ERR("gui_startup()", e) # Encapsulates references to gtk objects AND properties in main window,