Module: deluge Branch: master Commit: 53930e089809539abbd1a497dbcddb2dc8d5607b
Author: Damien Churchill <[email protected]> Date: Mon May 3 20:38:57 2010 +0100 handle non-supported images/files in the icons folder --- deluge/ui/tracker_icons.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/deluge/ui/tracker_icons.py b/deluge/ui/tracker_icons.py index 168ebaa..eb6f00c 100644 --- a/deluge/ui/tracker_icons.py +++ b/deluge/ui/tracker_icons.py @@ -142,7 +142,10 @@ class TrackerIcons(Component): for icon in os.listdir(self.dir): if icon != noIcon: host = icon_name_to_host(icon) - self.icons[host] = TrackerIcon(os.path.join(self.dir, icon)) + try: + self.icons[host] = TrackerIcon(os.path.join(self.dir, icon)) + except KeyError: + log.warning("invalid icon %s", icon) if noIcon: self.icons[None] = TrackerIcon(noIcon) else: @@ -479,6 +482,9 @@ def icon_name_to_host(icon): """ return icon.rpartition('.')[0] +MIME_MAP = { +} + def mimetype_to_ext(mimetype): """ Given a mimetype, returns the appropriate filename extension -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
