Fix display of tracker error messages

This commit is contained in:
Andrew Resch 2008-09-29 23:11:17 +00:00
commit 4b5dc6bc28
3 changed files with 4 additions and 3 deletions

View file

@ -2,7 +2,8 @@ Deluge 1.0.1 (In Development)
Core: Core:
* Change the default max global upload slots to 4 instead of -1 since libtorrent * Change the default max global upload slots to 4 instead of -1 since libtorrent
will automatically open more slots to meet the upload speed limit. will automatically open more slots to meet the upload speed limit.
* Fix display of tracker error messages
Misc: Misc:
* Fix #187 set a 5 second timer to save the config file after a config value * Fix #187 set a 5 second timer to save the config file after a config value
has been changed. has been changed.

View file

@ -715,8 +715,7 @@ class TorrentManager(component.Component):
def on_alert_tracker_error(self, alert): def on_alert_tracker_error(self, alert):
log.debug("on_alert_tracker_error") log.debug("on_alert_tracker_error")
torrent = self.torrents[str(alert.handle.info_hash())] torrent = self.torrents[str(alert.handle.info_hash())]
error_msg = " ".join(alert.message().split()[3:]).split(":")[0] tracker_status = "%s: %s" % (_("Error"), alert.msg)
tracker_status = "%s: %s" % (_("Error"), error_msg)
try: try:
torrent.set_tracker_status(tracker_status) torrent.set_tracker_status(tracker_status)
except KeyError: except KeyError:

View file

@ -104,6 +104,7 @@ void bind_alert()
class_<tracker_error_alert, bases<tracker_alert>, noncopyable>( class_<tracker_error_alert, bases<tracker_alert>, noncopyable>(
"tracker_error_alert", tracker_error_alert_doc, no_init "tracker_error_alert", tracker_error_alert_doc, no_init
) )
.def_readonly("msg", &tracker_error_alert::msg)
.def_readonly("times_in_row", &tracker_error_alert::times_in_row) .def_readonly("times_in_row", &tracker_error_alert::times_in_row)
.def_readonly("status_code", &tracker_error_alert::status_code) .def_readonly("status_code", &tracker_error_alert::status_code)
; ;