summaryrefslogtreecommitdiff
path: root/mat-gui
diff options
context:
space:
mode:
authorjvoisin2016-03-27 19:20:27 +0200
committerjvoisin2016-03-27 19:20:27 +0200
commite56992e8e0ef197974932cf3849f3e2fab7281df (patch)
treedbc60cce0d6121199abacce0fd6514c35014838a /mat-gui
parent368474eaaa6cce9d219ff1963ff31e521eca62e9 (diff)
Make the code a bit more python3-compliant
Diffstat (limited to 'mat-gui')
-rwxr-xr-xmat-gui10
1 files changed, 7 insertions, 3 deletions
diff --git a/mat-gui b/mat-gui
index 430641a..feccbd2 100755
--- a/mat-gui
+++ b/mat-gui
@@ -13,7 +13,11 @@ import logging
13import os 13import os
14import sys 14import sys
15import xml.sax 15import xml.sax
16import urllib2 16
17try:
18 from urllib2 import unquote
19except ImportError: # python3
20 from urllib.parse import unquote
17 21
18from libmat import mat 22from libmat import mat
19from libmat import strippers 23from libmat import strippers
@@ -168,7 +172,7 @@ class GUI(object):
168 metadataPopupListStore.append([_('No metadata found'), '']) 172 metadataPopupListStore.append([_('No metadata found'), ''])
169 else: 173 else:
170 self.liststore[row][2] = _('Dirty') 174 self.liststore[row][2] = _('Dirty')
171 for i, j in self.liststore[row][0].file.get_meta().iteritems(): 175 for i, j in self.liststore[row][0].file.get_meta().items():
172 metadataPopupListStore.append([i, j]) 176 metadataPopupListStore.append([i, j])
173 177
174 popup_metadata = self.builder.get_object('MetadataPopup') 178 popup_metadata = self.builder.get_object('MetadataPopup')
@@ -260,7 +264,7 @@ non-anonymised) file from output archive'))
260 """ Since the dragged urls are ugly, 264 """ Since the dragged urls are ugly,
261 we need to process them 265 we need to process them
262 """ 266 """
263 url = urllib2.unquote(url) # unquote url 267 url = unquote(url) # unquote url
264 url = url.decode('utf-8') # decode in utf-8 268 url = url.decode('utf-8') # decode in utf-8
265 if url.startswith('file:\\\\\\'): # windows 269 if url.startswith('file:\\\\\\'): # windows
266 return url[8:] # 8 is len('file:///') 270 return url[8:] # 8 is len('file:///')