move pause code in blocklist plugin

This commit is contained in:
Marcos Pinto 2007-09-17 03:56:42 +00:00
parent dcfb14d7e5
commit e4e4ded874
1 changed files with 7 additions and 6 deletions

View File

@ -54,12 +54,6 @@ class BlocklistImport:
self.gtkconf = GTKConfig(self)
self.gtkprog = GTKProgress(self)
self.nimported = 0
# Stop all torrents
self.paused_or_not = {}
for unique_ID in self.core.unique_IDs:
self.paused_or_not[unique_ID] = self.core.is_user_paused(unique_ID)
if not self.paused_or_not[unique_ID]:
self.core.set_user_pause(unique_ID, True, enforce_queue=False)
self.blockfile = deluge.common.CONFIG_DIR + "/blocklist.cache"
@ -77,6 +71,13 @@ class BlocklistImport:
self.gtkprog.download_prog(curr/incs)
def loadlist(self, fetch=False):
# Stop all torrents
self.paused_or_not = {}
for unique_ID in self.core.unique_IDs:
self.paused_or_not[unique_ID] = self.core.is_user_paused(unique_ID)
if not self.paused_or_not[unique_ID]:
self.core.set_user_pause(unique_ID, True, enforce_queue=False)
self.gtkprog.start()
# Attempt initial import