Move AutoAdd to core.

This commit is contained in:
Andrew Resch 2008-03-31 12:18:19 +00:00
commit 2a9993cfe8
2 changed files with 6 additions and 6 deletions

View file

@ -52,6 +52,7 @@ from deluge.core.torrentmanager import TorrentManager
from deluge.core.pluginmanager import PluginManager from deluge.core.pluginmanager import PluginManager
from deluge.core.alertmanager import AlertManager from deluge.core.alertmanager import AlertManager
from deluge.core.signalmanager import SignalManager from deluge.core.signalmanager import SignalManager
from deluge.core.autoadd import AutoAdd
from deluge.log import LOG as log from deluge.log import LOG as log
DEFAULT_PREFS = { DEFAULT_PREFS = {
@ -244,6 +245,9 @@ class Core(
# Start the TorrentManager # Start the TorrentManager
self.torrents = TorrentManager(self.session, self.alerts) self.torrents = TorrentManager(self.session, self.alerts)
# Create the AutoAdd component
self.autoadd = AutoAdd()
component.start() component.start()
t = threading.Thread(target=self.serve_forever) t = threading.Thread(target=self.serve_forever)

View file

@ -46,7 +46,7 @@ import deluge.component as component
from deluge.core.torrentqueue import TorrentQueue from deluge.core.torrentqueue import TorrentQueue
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
from deluge.core.torrent import Torrent from deluge.core.torrent import Torrent
from deluge.core.autoadd import AutoAdd
from deluge.log import LOG as log from deluge.log import LOG as log
class TorrentState: class TorrentState:
@ -140,9 +140,6 @@ class TorrentManager(component.Component):
self.on_alert_storage_moved) self.on_alert_storage_moved)
self.alerts.register_handler("file_error_alert", self.on_alert_file_error) self.alerts.register_handler("file_error_alert", self.on_alert_file_error)
# Create the AutoAdd component
self.autoadd = AutoAdd()
def start(self): def start(self):
# Get the pluginmanager reference # Get the pluginmanager reference
self.plugins = component.get("PluginManager") self.plugins = component.get("PluginManager")
@ -633,7 +630,6 @@ class TorrentManager(component.Component):
# Get the torrent_id # Get the torrent_id
torrent_id = str(alert.handle.info_hash()) torrent_id = str(alert.handle.info_hash())
# Set the torrent state # Set the torrent state
log.debug("self.torrents: %s", self.torrents)
if not self.torrents[torrent_id].handle.is_paused(): if not self.torrents[torrent_id].handle.is_paused():
if self.torrents[torrent_id].handle.is_seed(): if self.torrents[torrent_id].handle.is_seed():
self.torrents[torrent_id].set_state("Seeding") self.torrents[torrent_id].set_state("Seeding")