adaption for python version less 3.x (see issue 6465) for details
svn: r21515
This commit is contained in:
parent
98fa69b717
commit
06b8b291f8
@ -185,17 +185,17 @@ class MediaView(ListView):
|
|||||||
if not sel_data:
|
if not sel_data:
|
||||||
return
|
return
|
||||||
#modern file managers provide URI_LIST. For Windows split sel_data.data
|
#modern file managers provide URI_LIST. For Windows split sel_data.data
|
||||||
if win():
|
files = sel_data.get_uris()
|
||||||
files = sel_data.data.split('\n')
|
|
||||||
else:
|
|
||||||
files = sel_data.get_uris()
|
|
||||||
for file in files:
|
for file in files:
|
||||||
clean_string = fix_encoding(
|
clean_string = fix_encoding(
|
||||||
file.replace('\0',' ').replace("\r", " ").strip())
|
file.replace('\0',' ').replace("\r", " ").strip())
|
||||||
protocol, site, mfile, j, k, l = urlparse(clean_string)
|
protocol, site, mfile, j, k, l = urlparse(clean_string)
|
||||||
if protocol == "file":
|
if protocol == "file":
|
||||||
name = cuni(url2pathname(
|
if sys.version_info[0] < 3:
|
||||||
|
name = cuni(url2pathname(
|
||||||
mfile.encode(glocale.getfilesystemencoding())))
|
mfile.encode(glocale.getfilesystemencoding())))
|
||||||
|
else:
|
||||||
|
name = cuni(url2pathname(mfile))
|
||||||
mime = get_type(name)
|
mime = get_type(name)
|
||||||
if not is_valid_type(mime):
|
if not is_valid_type(mime):
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user