diff --git a/deluge/plugins/blocklist/blocklist/core.py b/deluge/plugins/blocklist/blocklist/core.py index 24d3c31f5..7830632ac 100644 --- a/deluge/plugins/blocklist/blocklist/core.py +++ b/deluge/plugins/blocklist/blocklist/core.py @@ -151,6 +151,7 @@ class Core(CorePluginBase): else: status["state"] = "Idle" + status["up_to_date"] = False status["num_blocked"] = self.num_blocked status["file_progress"] = self.file_progress status["file_type"] = self.config["list_type"] @@ -233,24 +234,10 @@ class Core(CorePluginBase): log.debug("Latest blocklist is already imported") return True - self.is_importing = True - log.debug("Reset IP Filter..") - # Does this return a deferred? - self.core.reset_ip_filter() - self.num_blocked = 0 - # TODO: Make non-blocking (use deferToThread) - - # Open the file for reading - read_list = FORMATS[self.config["listtype"]][1](bl_file) - log.debug("Blocklist import starting..") - ips = read_list.next() - while ips: - self.core.block_ip_range(ips) - self.num_blocked += 1 - ips = read_list.next() - read_list.close() + # TODO: Open blocklist with appropriate reader + # TODO: Import ranges def on_import_complete(self, result): """Runs any import clean up functions""" diff --git a/deluge/plugins/blocklist/blocklist/gtkui.py b/deluge/plugins/blocklist/blocklist/gtkui.py index 17bae84dd..8483fd20c 100644 --- a/deluge/plugins/blocklist/blocklist/gtkui.py +++ b/deluge/plugins/blocklist/blocklist/gtkui.py @@ -134,7 +134,7 @@ class GtkUI(GtkPluginBase): # Update the combo box. It's ugly, get over it. self.glade.get_widget("combobox_types").set_active_iter( self.glade.get_widget("combobox_types").get_model().\ - get_iter(FORMATS[config["listtype"]][1])) + get_iter(FORMATS[config["list_type"]][1])) self.glade.get_widget("entry_url").set_text( config["url"]) @@ -149,7 +149,7 @@ class GtkUI(GtkPluginBase): def _on_apply_prefs(self): config = {} - config["listtype"] = self.glade.get_widget("combobox_types").\ + config["list_type"] = self.glade.get_widget("combobox_types").\ get_model()[self.glade.get_widget("combobox_types").get_active()][1] config["url"] = self.glade.get_widget("entry_url").get_text() config["check_after_days"] = self.glade.get_widget("spin_check_days").get_value_as_int()