Commit e56992e8 authored by jvoisin's avatar jvoisin

Make the code a bit more python3-compliant

parent 368474ea
......@@ -52,7 +52,7 @@ def list_meta(class_file, filename, add2archive):
print ('Harmful metadata found:')
meta = class_file.get_meta()
if meta:
for key, value in class_file.get_meta().iteritems():
for key, value in class_file.get_meta().items():
print('\t%s: %s' % (key, value))
return 0
......
......@@ -13,7 +13,11 @@ import logging
import os
import sys
import xml.sax
import urllib2
try:
from urllib2 import unquote
except ImportError: # python3
from urllib.parse import unquote
from libmat import mat
from libmat import strippers
......@@ -168,7 +172,7 @@ class GUI(object):
metadataPopupListStore.append([_('No metadata found'), ''])
else:
self.liststore[row][2] = _('Dirty')
for i, j in self.liststore[row][0].file.get_meta().iteritems():
for i, j in self.liststore[row][0].file.get_meta().items():
metadataPopupListStore.append([i, j])
popup_metadata = self.builder.get_object('MetadataPopup')
......@@ -260,7 +264,7 @@ non-anonymised) file from output archive'))
""" Since the dragged urls are ugly,
we need to process them
"""
url = urllib2.unquote(url) # unquote url
url = unquote(url) # unquote url
url = url.decode('utf-8') # decode in utf-8
if url.startswith('file:\\\\\\'): # windows
return url[8:] # 8 is len('file:///')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment