From 182845ce3edb22ccba96263c62b6e294757bda84 Mon Sep 17 00:00:00 2001 From: John Garland Date: Wed, 24 Jun 2009 03:22:06 +0000 Subject: [PATCH] Fixed #916. Removed unused code. --- deluge/plugins/label/label/core.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/deluge/plugins/label/label/core.py b/deluge/plugins/label/label/core.py index b5afe3b77..52017670f 100644 --- a/deluge/plugins/label/label/core.py +++ b/deluge/plugins/label/label/core.py @@ -102,7 +102,6 @@ class Core(CorePluginBase): core = component.get("Core") self.config = ConfigManager("label.conf", defaults=CONFIG_DEFAULTS) self.core_cfg = ConfigManager("core.conf") - #self.set_config_defaults() #reduce typing, assigning some values to self... self.torrents = core.torrentmanager.torrents @@ -130,8 +129,6 @@ class Core(CorePluginBase): return dict( [(label, 0) for label in self.labels.keys()]) ## Plugin hooks ## - - def post_torrent_add(self, torrent_id): log.debug("post_torrent_add") torrent = self.torrents[torrent_id] @@ -139,7 +136,7 @@ class Core(CorePluginBase): for label_id, options in self.labels.iteritems(): if options["auto_add"]: if self._has_auto_match(torrent, options): - self.export_set_torrent(torrent_id, label_id) + self.set_torrent(torrent_id, label_id) return def post_torrent_remove(self, torrent_id): @@ -147,7 +144,6 @@ class Core(CorePluginBase): if torrent_id in self.torrent_labels: del self.torrent_labels[torrent_id] - ## Utils ## def clean_config(self): "remove invalid data from config-file" @@ -176,16 +172,6 @@ class Core(CorePluginBase): self.clean_config() self.config.save() - def set_config_defaults(self): - #TODO : there is a deluge builtin for this, use it! - changed = False - for key, value in CONFIG_DEFAULTS.iteritems(): - if not key in self.config.config: - self.config[key] = value - changed = True - if changed: - self.config.save() - @export() def get_labels(self): return sorted(self.labels.keys())