Ensure status message is reset after leaving Error state

Also clean up comments in core.py
This commit is contained in:
Calum Lind 2014-01-19 16:11:31 +00:00
parent 64fd94e51e
commit 7271472e13
2 changed files with 17 additions and 8 deletions

View File

@ -88,24 +88,34 @@ class Core(component.Component):
# Load the session state if available
self.__load_session_state()
# Set the user agent
## Set Session settings ##
settings = self.session.get_settings()
# User agent
settings["user_agent"] = "Deluge/%(deluge_version)s libtorrent/%(lt_version)s" % {
'deluge_version': deluge.common.get_version(),
'lt_version': self.get_libtorrent_version().rpartition(".")[0]
}
# Increase the alert queue size so that alerts don't get lost
# Increase the alert queue size so that alerts don't get lost.
settings["alert_queue_size"] = 10000
# Set session settings
# Send have messages to peers that already have the piece.
settings["send_redundant_have"] = True
# On Windows OS set the disk I/O read/write to bypass OS cache
if deluge.common.windows_check():
settings["disk_io_write_mode"] = lt.io_buffer_mode_t.disable_os_cache
settings["disk_io_read_mode"] = lt.io_buffer_mode_t.disable_os_cache
self.session.set_settings(settings)
self.session.set_settings(settings)
## End Set Session settings ##
## libtorrent plugins ##
# Allows peers to download the metadata from the swarm directly
self.session.add_extension("metadata_transfer")
self.session.add_extension("ut_metadata")
# Ban peers that sends bad data
self.session.add_extension("smart_ban")
# Create the components

View File

@ -187,10 +187,7 @@ class Torrent(object):
# Status message holds error info about the torrent
self.statusmsg = "OK"
# The torrents state
# This is only one out of 4 calls to update_state for each torrent on startup.
# This call doesn't seem to be necessary, it can probably be removed
#self.update_state()
# The torrent's state
self.state = None
self.tracker_status = ""
@ -464,6 +461,8 @@ class Torrent(object):
if status.paused:
self.handle.auto_managed(False)
return
else:
self.set_status_message("OK")
if ltstate == LTSTATE["Queued"] or ltstate == LTSTATE["Checking"]:
if status.paused: