Module: deluge
Branch: master
Commit: 095f4ff20aac4285503b94b3fb14f8fd8c55ff0d

Author: Calum Lind <[email protected]>
Date:   Thu Jun 16 02:57:20 2011 +0100

Fix path error with torrent files prefixed with 'file://' from Firefox

---

 deluge/ui/gtkui/ipcinterface.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/deluge/ui/gtkui/ipcinterface.py b/deluge/ui/gtkui/ipcinterface.py
index f63a8a4..a858a37 100644
--- a/deluge/ui/gtkui/ipcinterface.py
+++ b/deluge/ui/gtkui/ipcinterface.py
@@ -92,7 +92,7 @@ class IPCInterface(component.Component):
         for arg in args:
             if arg.strip():
                 if not deluge.common.is_magnet(arg) and not 
deluge.common.is_url(arg):
-                    arg = os.path.abspath(arg)
+                    arg = os.path.abspath(arg.replace('file://', '', 1))
                 _args.append(arg)
         args = _args
 
@@ -220,11 +220,9 @@ def process_args(args):
                 client.core.add_torrent_magnet(arg, {})
         else:
             # Just a file
-            log.debug("Attempting to add %s from external source..",
-                os.path.abspath(arg))
+            log.debug("Attempting to add %s from external source..", arg)
             if config["interactive_add"]:
-                
component.get("AddTorrentDialog").add_from_files([os.path.abspath(arg)])
+                component.get("AddTorrentDialog").add_from_files([arg])
                 
component.get("AddTorrentDialog").show(config["focus_add_dialog"])
             else:
-                path = os.path.abspath(arg)
-                client.core.add_torrent_file(os.path.split(path)[-1], 
base64.encodestring(open(path, "rb").read()), None)
+                client.core.add_torrent_file(os.path.split(arg)[-1], 
base64.encodestring(open(arg, "rb").read()), None)

-- 
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.

Reply via email to