From 9bfa5f10b6a271b4d1ae80fbe12d69b5941acbd8 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 22 Nov 2009 03:55:36 +0000 Subject: [PATCH] Since the WebUI does not yet do anything, remove it's entry point from the notifications plugin. Cleanup debugging output. --- .../plugins/notifications/notifications/common.py | 15 ++++++++------- .../plugins/notifications/notifications/gtkui.py | 2 -- .../plugins/notifications/notifications/webui.py | 11 ----------- deluge/plugins/notifications/setup.py | 4 +--- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/deluge/plugins/notifications/notifications/common.py b/deluge/plugins/notifications/notifications/common.py index 12bb27436..0d82b50d5 100644 --- a/deluge/plugins/notifications/notifications/common.py +++ b/deluge/plugins/notifications/notifications/common.py @@ -88,7 +88,7 @@ class CustomNotifications(object): self._deregister_custom_provider(kind, eventtype) def _handle_custom_providers(self, kind, eventtype, *args, **kwargs): - log.debug("\n\nCalling CORE's custom %s providers for %s: %s %s", + log.debug("Calling CORE's custom %s providers for %s: %s %s", kind, eventtype, args, kwargs) if eventtype in self.config["subscriptions"][kind]: wrapper, handler = self.custom_notifications[kind][eventtype] @@ -143,11 +143,11 @@ class CustomNotifications(object): return True def _on_notify_sucess(self, result, kind): - log.debug("\n\nNotification success using %s: %s", kind, result) + log.debug("Notification success using %s: %s", kind, result) return result def _on_notify_failure(self, failure, kind): - log.debug("\n\nNotification failure using %s: %s", kind, failure) + log.debug("Notification failure using %s: %s", kind, failure) return failure @@ -179,7 +179,7 @@ class CoreNotifications(CustomNotifications): if not self.config['smtp_enabled']: return defer.succeed("SMTP notification not enabled.") subject, message = result - log.debug("\n\nSpawning new thread to send email with subject: %s: %s", + log.debug("Spawning new thread to send email with subject: %s: %s", subject, message) # Spawn thread because we don't want Deluge to lock up while we send the # email. @@ -219,7 +219,7 @@ Subject: %(subject)s self.config["smtp_port"], timeout=60) except: - # Python 2.6 + # Python 2.5 server = smtplib.SMTP(self.config["smtp_host"], self.config["smtp_port"]) except Exception, err: @@ -275,7 +275,7 @@ Subject: %(subject)s def _on_torrent_finished_event(self, torrent_id): - log.debug("\n\nHandler for TorrentFinishedEvent called for CORE") + log.debug("Handler for TorrentFinishedEvent called for CORE") torrent = component.get("TorrentManager")[torrent_id] torrent_status = torrent.get_status({}) # Email @@ -442,7 +442,8 @@ class GtkUiNotifications(CustomNotifications): log.debug("Failed to get torrent status to be able to show the popup") def _on_torrent_finished_event_got_torrent_status(self, torrent_status): - log.debug("\n\nhandler for TorrentFinishedEvent GTKUI called. Torrent Status") + log.debug("Handler for TorrentFinishedEvent GTKUI called. " + "Got Torrent Status") title = _("Finished Torrent") message = _("The torrent \"%(name)s\" including %(num_files)i " "has finished downloading.") % torrent_status diff --git a/deluge/plugins/notifications/notifications/gtkui.py b/deluge/plugins/notifications/notifications/gtkui.py index 164fe0958..c33618ade 100644 --- a/deluge/plugins/notifications/notifications/gtkui.py +++ b/deluge/plugins/notifications/notifications/gtkui.py @@ -318,7 +318,6 @@ class GtkUI(GtkPluginBase, GtkUiNotifications): if filepath == old_sound_file: continue custom_sounds[event_name] = filepath - log.debug(custom_sounds) self.config.config.update({ "popup_enabled": self.glade.get_widget("popup_enabled").get_active(), @@ -411,7 +410,6 @@ class GtkUI(GtkPluginBase, GtkUiNotifications): model.remove(iter) def on_cell_edited(self, cell, path_string, new_text, model): - log.debug("%s %s %s %s", cell, path_string, new_text, model) iter = model.get_iter_from_string(path_string) path = model.get_path(iter)[0] model.set(iter, RECIPIENT_FIELD, new_text) diff --git a/deluge/plugins/notifications/notifications/webui.py b/deluge/plugins/notifications/notifications/webui.py index 0a3e07a5b..3abf447a9 100644 --- a/deluge/plugins/notifications/notifications/webui.py +++ b/deluge/plugins/notifications/notifications/webui.py @@ -72,14 +72,3 @@ class WebUI(WebPluginBase, component.Component): def disable(self): log.debug("Disabling Web UI notifications") - - def flash(self, title, message): - return defer.succeed("Web Flash Notifications not implemented yet") - - def _on_notify_sucess(self, result, kind): - log.debug("\n\nNotification success using %s: %s", kind, result) - return result - - def _on_notify_failure(self, failure, kind): - log.debug("\n\nNotification failure using %s: %s", kind, failure) - return failure diff --git a/deluge/plugins/notifications/setup.py b/deluge/plugins/notifications/setup.py index b594df079..b9a080819 100755 --- a/deluge/plugins/notifications/setup.py +++ b/deluge/plugins/notifications/setup.py @@ -67,7 +67,5 @@ setup( %s = %s:CorePlugin [deluge.plugin.gtkui] %s = %s:GtkUIPlugin - [deluge.plugin.webui] - %s = %s:WebUIPlugin - """ % ((__plugin_name__, __plugin_name__.lower())*3) + """ % ((__plugin_name__, __plugin_name__.lower())*2) )