Touch up the gtkui...
Content-type: text/plain
Author: andar
Revision: 5307
Log:
Fix the extracting command call
Touch up the gtkui config a bit
Diff:
Modified: trunk/deluge/plugins/extractor/extractor/core.py
===================================================================
--- trunk/deluge/plugins/extractor/extractor/core.py 2009-05-25 22:55:42 UTC
(rev 5306)
+++ trunk/deluge/plugins/extractor/extractor/core.py 2009-05-27 02:32:00 UTC
(rev 5307)
@@ -63,6 +63,9 @@
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 @@
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 @@
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)
Modified: trunk/deluge/plugins/extractor/extractor/data/extractor_prefs.glade
===================================================================
--- trunk/deluge/plugins/extractor/extractor/data/extractor_prefs.glade
2009-05-25 22:55:42 UTC (rev 5306)
+++ trunk/deluge/plugins/extractor/extractor/data/extractor_prefs.glade
2009-05-27 02:32:00 UTC (rev 5307)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Fri May 1 18:23:42 2009 -->
+<!--Generated with glade3 3.4.5 on Wed May 6 12:45:11 2009 -->
<glade-interface>
<widget class="GtkWindow" id="window1">
<child>
@@ -13,49 +13,51 @@
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
- <widget class="GtkAlignment" id="alignment1">
+ <widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="border_width">5</property>
+ <property name="spacing">5</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="spacing">5</property>
+ <property name="label" translatable="yes">Extract
to:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Extract
to:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
<widget class="GtkFileChooserButton"
id="folderchooser_path">
- <property name="visible">True</property>
<property
name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
<property name="title" translatable="yes">Select A
Folder</property>
</widget>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
<child>
<widget class="GtkEntry" id="entry_path">
- <property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
</child>
</widget>
</child>
@@ -70,10 +72,6 @@
</packing>
</child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
</widget>
</child>
Modified: trunk/deluge/plugins/extractor/extractor/gtkui.py
===================================================================
--- trunk/deluge/plugins/extractor/extractor/gtkui.py 2009-05-25 22:55:42 UTC
(rev 5306)
+++ trunk/deluge/plugins/extractor/extractor/gtkui.py 2009-05-27 02:32:00 UTC
(rev 5307)
@@ -54,8 +54,8 @@
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")
component.get("PluginManager").deregister_hook("on_apply_prefs",
self.on_apply_prefs)
@@ -82,7 +82,6 @@
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():
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---