3.9 python finally removed unescape
This commit is contained in:
@@ -19,7 +19,7 @@ import sys,os
|
||||
import re
|
||||
import urllib
|
||||
import urllib.parse
|
||||
from html.parser import HTMLParser
|
||||
from html import unescape
|
||||
import shutil
|
||||
import csv
|
||||
import subprocess
|
||||
@@ -184,15 +184,14 @@ def getpathlist(path,options=False):
|
||||
def pathscript(path,list):
|
||||
''' Returns the javascript string of pathlist and pathimage arrays '''
|
||||
scrstr = '<script language="javascript">var pathlist=['
|
||||
parser = HTMLParser()
|
||||
elements = []
|
||||
for p in list:
|
||||
imglist = getimagelist(os.path.join(path,p))
|
||||
pathlist = getpathlist(os.path.join(path,p))
|
||||
this_str = '{ name:"'+ parser.unescape(p) + '", '
|
||||
this_str = '{ name:"'+ unescape(p) + '", '
|
||||
this_str += 'size:' + str(len(imglist) + len(pathlist)) + ', '
|
||||
if len(imglist) > 0:
|
||||
this_str += 'image:"'+parser.unescape(p) + '/.tn/'+parser.unescape(imglist[0]) + '.jpg"}'
|
||||
this_str += 'image:"'+unescape(p) + '/.tn/'+unescape(imglist[0]) + '.jpg"}'
|
||||
else:
|
||||
this_str += 'image:"" }'
|
||||
elements.append(this_str)
|
||||
@@ -456,9 +455,6 @@ def sizestring(size):
|
||||
size /= 1024.0
|
||||
|
||||
|
||||
def unescape(s):
|
||||
return HTMLParser().unescape(s)
|
||||
|
||||
|
||||
def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
|
||||
''' Natural sort / Claudiu@Stackoverflow '''
|
||||
|
||||
Reference in New Issue
Block a user