diff options
| author | jvoisin | 2011-12-05 16:39:04 +0100 |
|---|---|---|
| committer | jvoisin | 2011-12-05 16:39:04 +0100 |
| commit | dbafbe86ea041525c38370812d6b0a01d2e48eba (patch) | |
| tree | 8d78f50d195279cc10a34c1501f3f1d68ef2732d /mat-gui | |
| parent | 697cf6187671c92bf9a81572e5329a1dea3c21e7 (diff) | |
Correct handling of filenames with spaces in mat-gui
Diffstat (limited to 'mat-gui')
| -rwxr-xr-x | mat-gui | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -15,6 +15,7 @@ import os | |||
| 15 | import sys | 15 | import sys |
| 16 | import mimetypes | 16 | import mimetypes |
| 17 | import xml.sax | 17 | import xml.sax |
| 18 | import urllib2 | ||
| 18 | 19 | ||
| 19 | from mat import mat | 20 | from mat import mat |
| 20 | from mat import strippers | 21 | from mat import strippers |
| @@ -460,7 +461,7 @@ non-anonymised) file to output archive')) | |||
| 460 | It basically add files. | 461 | It basically add files. |
| 461 | ''' | 462 | ''' |
| 462 | urls = selection.data.strip('\r\n\x00') # strip stupid characters | 463 | urls = selection.data.strip('\r\n\x00') # strip stupid characters |
| 463 | cleaned_urls = map(self.clean_draged_file_path, urls.split()) | 464 | cleaned_urls = map(self.clean_draged_file_path, urls.split('\n')) |
| 464 | task = self.populate(cleaned_urls) | 465 | task = self.populate(cleaned_urls) |
| 465 | gobject.idle_add(task.next) # asynchrone processing | 466 | gobject.idle_add(task.next) # asynchrone processing |
| 466 | 467 | ||
| @@ -469,6 +470,7 @@ non-anonymised) file to output archive')) | |||
| 469 | Since the dragged urls are ugly, | 470 | Since the dragged urls are ugly, |
| 470 | we need to process them | 471 | we need to process them |
| 471 | ''' | 472 | ''' |
| 473 | url = urllib2.unquote(url) # unescape stupid chars | ||
| 472 | if url.startswith('file:\\\\\\'): # windows | 474 | if url.startswith('file:\\\\\\'): # windows |
| 473 | return url[8:] # 8 is len('file:///') | 475 | return url[8:] # 8 is len('file:///') |
| 474 | elif url.startswith('file://'): # nautilus, rox | 476 | elif url.startswith('file://'): # nautilus, rox |
