summaryrefslogtreecommitdiff
path: root/mat-gui
diff options
context:
space:
mode:
Diffstat (limited to 'mat-gui')
-rwxr-xr-xmat-gui36
1 files changed, 20 insertions, 16 deletions
diff --git a/mat-gui b/mat-gui
index 6f100ec..57d04d9 100755
--- a/mat-gui
+++ b/mat-gui
@@ -529,23 +529,27 @@ non-anonymised) file to output archive'))
529 drag'n'droped into mat. 529 drag'n'droped into mat.
530 It basically add files. 530 It basically add files.
531 ''' 531 '''
532 urls = selection.data.strip('\r\n\x00') # strip stupid characters
533 cleaned_urls = map(self.__clean_draged_file_path, urls.split('\n'))
534 task = self.populate(cleaned_urls)
535 GObject.idle_add(task.next) # asynchrone processing
536 532
537 def __clean_draged_file_path(self, url): 533
538 ''' 534 def clean_path(url):
539 Since the dragged urls are ugly, 535 '''
540 we need to process them 536 Since the dragged urls are ugly,
541 ''' 537 we need to process them
542 url = urllib2.unquote(url) # unescape stupid chars 538 '''
543 if url.startswith('file:\\\\\\'): # windows 539 url = urllib2.unquote(url) # unescape stupid chars
544 return url[8:] # 8 is len('file:///') 540 url = url.replace('\n', '')
545 elif url.startswith('file://'): # nautilus, rox 541 if url.startswith('file:\\\\\\'): # windows
546 return url[7:] # 7 is len('file://') 542 return url[8:] # 8 is len('file:///')
547 elif url.startswith('file:'): # xffm 543 elif url.startswith('file://'): # nautilus, rox
548 return url[5:] # 5 is len('file:') 544 return url[7:] # 7 is len('file://')
545 elif url.startswith('file:'): # xffm
546 return url[5:] # 5 is len('file:')
547
548 urls = selection.get_data().split('\r')
549 urls = urls[:-1] # last entry in only a '\n'
550 urls = map(clean_path, urls)
551 task = self.populate(urls)
552 GObject.idle_add(task.next) # asynchrone processing
549 553
550 def __process_files(self, button, func): 554 def __process_files(self, button, func):
551 ''' 555 '''