From dbafbe86ea041525c38370812d6b0a01d2e48eba Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 5 Dec 2011 16:39:04 +0100 Subject: Correct handling of filenames with spaces in mat-gui --- mat-gui | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mat-gui b/mat-gui index 9ea49b2..3110d23 100755 --- a/mat-gui +++ b/mat-gui @@ -15,6 +15,7 @@ import os import sys import mimetypes import xml.sax +import urllib2 from mat import mat from mat import strippers @@ -460,7 +461,7 @@ non-anonymised) file to output archive')) It basically add files. ''' urls = selection.data.strip('\r\n\x00') # strip stupid characters - cleaned_urls = map(self.clean_draged_file_path, urls.split()) + cleaned_urls = map(self.clean_draged_file_path, urls.split('\n')) task = self.populate(cleaned_urls) gobject.idle_add(task.next) # asynchrone processing @@ -469,6 +470,7 @@ non-anonymised) file to output archive')) Since the dragged urls are ugly, we need to process them ''' + url = urllib2.unquote(url) # unescape stupid chars if url.startswith('file:\\\\\\'): # windows return url[8:] # 8 is len('file:///') elif url.startswith('file://'): # nautilus, rox -- cgit v1.3