← Back to team overview

phatch-dev team mailing list archive

[Bug 382766] Re: Drag and drop multiple images from F-Spot fails

 

@Droopy
It was very easy to fix. The fix is in the bazaar repository (bzr branch lp:phatch) and will be part of the next release. Please keep on filing bugs but of course check first if it has not been reported earlier.

$ bzr diff
=== modified file 'phatch/pyWx/lib/droplet.py'
--- phatch/pyWx/lib/droplet.py	2009-05-21 03:04:27 +0000
+++ phatch/pyWx/lib/droplet.py	2009-06-02 14:30:45 +0000
@@ -15,17 +15,29 @@
 
 #standard modules
 import os
+import types
 
 #gui-dependent
 import wx
 
+def fix_paths(paths):
+    if isinstance(paths,(types.ListType,types.TupleType)) \
+        and len(paths) == 1:
+        paths   = paths[0]
+    if isinstance(paths,types.StringTypes):
+        paths   = paths.strip().split('\n')
+    for index, path in enumerate(paths):
+        if path.startswith('file://'):
+            paths[index] = path[7:]
+    return paths
+
 class FileDropTarget(wx.FileDropTarget):
     def __init__(self, method):
         super(FileDropTarget,self).__init__()
         self.method     = method
 
     def OnDropFiles(self, x, y, filenames):
-        self.method(filenames,x,y)
+        self.method(fix_paths(filenames),x,y)
         
 class Mixin:
     def SetAsFileDropTarget(self,object,method):

stani@blue:~/sync/python/phatch/trunk/phatch$ bzr commit -m "fix drag and drop from f-spot"
Committing to: /home/stani/sync/python/phatch/trunk/                           
modified phatch/pyWx/lib/droplet.py                                            
Committed revision 624.       

** Changed in: phatch
       Status: Confirmed => In Progress

** Changed in: phatch
       Status: In Progress => Fix Committed

-- 
Drag and drop multiple images from F-Spot fails
https://bugs.launchpad.net/bugs/382766
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.

Status in Phatch = Photo & Batch!: Fix Committed

Bug description:
When I drag and drop several images from F-Spot, I can't process the batch.
If I use only one image, it works fine

Tested on OpenSuse 11 - phatch 0.1.6



References