From 6c023c111faaa99958d9d225f3adf55442fd4277 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 27 May 2009 02:32:00 +0000 Subject: [PATCH] Fix the extracting command call Touch up the gtkui config a bit --- deluge/plugins/extractor/extractor/core.py | 7 ++- .../extractor/data/extractor_prefs.glade | 58 +++++++++---------- deluge/plugins/extractor/extractor/gtkui.py | 3 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/deluge/plugins/extractor/extractor/core.py b/deluge/plugins/extractor/extractor/core.py index bdcfd12dd..8b20a2683 100644 --- a/deluge/plugins/extractor/extractor/core.py +++ b/deluge/plugins/extractor/extractor/core.py @@ -63,6 +63,9 @@ EXTRACT_COMMANDS = { class Core(CorePluginBase): def enable(self): self.config = deluge.configmanager.ConfigManager("extractor.conf", DEFAULT_PREFS) + if not self.config["extract_path"]: + self.config["extract_path"] = deluge.configmanager.ConfigManager("core.conf")["download_location"] + component.get("EventManager").register_event_handler("TorrentFinishedEvent", self._on_torrent_finished) def disable(self): @@ -81,7 +84,7 @@ class Core(CorePluginBase): files = component.get("TorrentManager")[torrent_id].get_files() for f in files: ext = os.path.splitext(f["path"]) - if ext in (".gz", ".bz2", ".lzma"): + if ext[1] in (".gz", ".bz2", ".lzma"): # We need to check if this is a tar if os.path.splitext(ext[0]) == ".tar": cmd = EXTRACT_COMMANDS[".tar" + ext[1]] @@ -108,7 +111,7 @@ class Core(CorePluginBase): log.debug("Extract failed for %s", torrent_id) # Run the command and add some callbacks - d = getProcessValue(cmd[0], cmd[1:] + [fp], {}, dest) + d = getProcessValue(cmd[0], cmd[1].split() + [str(fp)], {}, str(dest)) d.addCallback(on_extract_success, torrent_id) d.addErrback(on_extract_failed, torrent_id) diff --git a/deluge/plugins/extractor/extractor/data/extractor_prefs.glade b/deluge/plugins/extractor/extractor/data/extractor_prefs.glade index 0d3f4ccbb..ee6d536b0 100644 --- a/deluge/plugins/extractor/extractor/data/extractor_prefs.glade +++ b/deluge/plugins/extractor/extractor/data/extractor_prefs.glade @@ -1,6 +1,6 @@ - + @@ -13,49 +13,51 @@ 0 GTK_SHADOW_NONE - + True - 12 + 5 + 5 - + True 5 - + + True + Extract to: + + + False + False + + + + True - 5 - - - True - Extract to: - - - False - False - - - True GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER Select A Folder + + + + True + 1 - - - True - True - - - 2 - - + + 1 + + + False + False + @@ -70,10 +72,6 @@ - - False - False - diff --git a/deluge/plugins/extractor/extractor/gtkui.py b/deluge/plugins/extractor/extractor/gtkui.py index c283d603f..8f0da11d0 100644 --- a/deluge/plugins/extractor/extractor/gtkui.py +++ b/deluge/plugins/extractor/extractor/gtkui.py @@ -54,7 +54,7 @@ class GtkUI(GtkPluginBase): component.get("Preferences").add_page("Extractor", self.glade.get_widget("extractor_prefs_box")) component.get("PluginManager").register_hook("on_apply_prefs", self.on_apply_prefs) component.get("PluginManager").register_hook("on_show_prefs", self.on_show_prefs) - + self.on_show_prefs() def disable(self): component.get("Preferences").remove_page("Extractor") @@ -82,7 +82,6 @@ class GtkUI(GtkPluginBase): else: self.glade.get_widget("folderchooser_path").hide() self.glade.get_widget("entry_path").show() - self.glade.get_widget("folderchooser_path").show() def on_get_config(config): if client.is_localhost():