mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +00:00
Since the WebUI does not yet do anything, remove it's entry point from the notifications plugin.
Cleanup debugging output.
This commit is contained in:
parent
67c0f8609b
commit
9bfa5f10b6
4 changed files with 9 additions and 23 deletions
|
@ -88,7 +88,7 @@ class CustomNotifications(object):
|
||||||
self._deregister_custom_provider(kind, eventtype)
|
self._deregister_custom_provider(kind, eventtype)
|
||||||
|
|
||||||
def _handle_custom_providers(self, kind, eventtype, *args, **kwargs):
|
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)
|
kind, eventtype, args, kwargs)
|
||||||
if eventtype in self.config["subscriptions"][kind]:
|
if eventtype in self.config["subscriptions"][kind]:
|
||||||
wrapper, handler = self.custom_notifications[kind][eventtype]
|
wrapper, handler = self.custom_notifications[kind][eventtype]
|
||||||
|
@ -143,11 +143,11 @@ class CustomNotifications(object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _on_notify_sucess(self, result, kind):
|
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
|
return result
|
||||||
|
|
||||||
def _on_notify_failure(self, failure, kind):
|
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
|
return failure
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ class CoreNotifications(CustomNotifications):
|
||||||
if not self.config['smtp_enabled']:
|
if not self.config['smtp_enabled']:
|
||||||
return defer.succeed("SMTP notification not enabled.")
|
return defer.succeed("SMTP notification not enabled.")
|
||||||
subject, message = result
|
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)
|
subject, message)
|
||||||
# Spawn thread because we don't want Deluge to lock up while we send the
|
# Spawn thread because we don't want Deluge to lock up while we send the
|
||||||
# email.
|
# email.
|
||||||
|
@ -219,7 +219,7 @@ Subject: %(subject)s
|
||||||
self.config["smtp_port"],
|
self.config["smtp_port"],
|
||||||
timeout=60)
|
timeout=60)
|
||||||
except:
|
except:
|
||||||
# Python 2.6
|
# Python 2.5
|
||||||
server = smtplib.SMTP(self.config["smtp_host"],
|
server = smtplib.SMTP(self.config["smtp_host"],
|
||||||
self.config["smtp_port"])
|
self.config["smtp_port"])
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
|
@ -275,7 +275,7 @@ Subject: %(subject)s
|
||||||
|
|
||||||
|
|
||||||
def _on_torrent_finished_event(self, torrent_id):
|
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 = component.get("TorrentManager")[torrent_id]
|
||||||
torrent_status = torrent.get_status({})
|
torrent_status = torrent.get_status({})
|
||||||
# Email
|
# Email
|
||||||
|
@ -442,7 +442,8 @@ class GtkUiNotifications(CustomNotifications):
|
||||||
log.debug("Failed to get torrent status to be able to show the popup")
|
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):
|
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")
|
title = _("Finished Torrent")
|
||||||
message = _("The torrent \"%(name)s\" including %(num_files)i "
|
message = _("The torrent \"%(name)s\" including %(num_files)i "
|
||||||
"has finished downloading.") % torrent_status
|
"has finished downloading.") % torrent_status
|
||||||
|
|
|
@ -318,7 +318,6 @@ class GtkUI(GtkPluginBase, GtkUiNotifications):
|
||||||
if filepath == old_sound_file:
|
if filepath == old_sound_file:
|
||||||
continue
|
continue
|
||||||
custom_sounds[event_name] = filepath
|
custom_sounds[event_name] = filepath
|
||||||
log.debug(custom_sounds)
|
|
||||||
|
|
||||||
self.config.config.update({
|
self.config.config.update({
|
||||||
"popup_enabled": self.glade.get_widget("popup_enabled").get_active(),
|
"popup_enabled": self.glade.get_widget("popup_enabled").get_active(),
|
||||||
|
@ -411,7 +410,6 @@ class GtkUI(GtkPluginBase, GtkUiNotifications):
|
||||||
model.remove(iter)
|
model.remove(iter)
|
||||||
|
|
||||||
def on_cell_edited(self, cell, path_string, new_text, model):
|
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)
|
iter = model.get_iter_from_string(path_string)
|
||||||
path = model.get_path(iter)[0]
|
path = model.get_path(iter)[0]
|
||||||
model.set(iter, RECIPIENT_FIELD, new_text)
|
model.set(iter, RECIPIENT_FIELD, new_text)
|
||||||
|
|
|
@ -72,14 +72,3 @@ class WebUI(WebPluginBase, component.Component):
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
log.debug("Disabling Web UI notifications")
|
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
|
|
||||||
|
|
|
@ -67,7 +67,5 @@ setup(
|
||||||
%s = %s:CorePlugin
|
%s = %s:CorePlugin
|
||||||
[deluge.plugin.gtkui]
|
[deluge.plugin.gtkui]
|
||||||
%s = %s:GtkUIPlugin
|
%s = %s:GtkUIPlugin
|
||||||
[deluge.plugin.webui]
|
""" % ((__plugin_name__, __plugin_name__.lower())*2)
|
||||||
%s = %s:WebUIPlugin
|
|
||||||
""" % ((__plugin_name__, __plugin_name__.lower())*3)
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue