Removed unused code.
Content-type: text/plain
Author: johnnyg
Revision: 5415
Log:
Fixed #916.
Removed unused code.
Diff:
Modified: branches/1.1.0_RC/deluge/plugins/label/label/core.py
===================================================================
--- branches/1.1.0_RC/deluge/plugins/label/label/core.py 2009-06-24
02:54:39 UTC (rev 5414)
+++ branches/1.1.0_RC/deluge/plugins/label/label/core.py 2009-06-24
03:22:06 UTC (rev 5415)
@@ -102,7 +102,6 @@
core = self.plugin.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.torrents.torrents
@@ -178,16 +177,6 @@
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()
-
def export_get_labels(self):
return sorted(self.labels.keys())
Modified: trunk/deluge/plugins/label/label/core.py
===================================================================
--- trunk/deluge/plugins/label/label/core.py 2009-06-24 02:54:39 UTC (rev
5414)
+++ trunk/deluge/plugins/label/label/core.py 2009-06-24 03:22:06 UTC (rev
5415)
@@ -102,7 +102,6 @@
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 @@
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 @@
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 @@
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 @@
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())
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---