|
|
@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
from HTMLParser import HTMLParser
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
reload(sys)
|
|
|
|
|
|
|
|
sys.setdefaultencoding("UTF-8")
|
|
|
|
|
|
|
|
|
|
|
|
class ResolverError(Exception):
|
|
|
|
class ResolverError(Exception):
|
|
|
|
def __init__(self, value):
|
|
|
|
def __init__(self, value):
|
|
|
|
self.val = value
|
|
|
|
self.val = value
|
|
|
@ -6,9 +12,4 @@ class ResolverError(Exception):
|
|
|
|
return repr(self.val)
|
|
|
|
return repr(self.val)
|
|
|
|
|
|
|
|
|
|
|
|
def unescape(s):
|
|
|
|
def unescape(s):
|
|
|
|
s = s.replace("<", "<")
|
|
|
|
return HTMLParser.unescape.__func__(HTMLParser, s)
|
|
|
|
s = s.replace(">", ">")
|
|
|
|
|
|
|
|
s = s.replace(""", '"')
|
|
|
|
|
|
|
|
s = s.replace("'", "'")
|
|
|
|
|
|
|
|
s = s.replace("&", "&")
|
|
|
|
|
|
|
|
return s
|
|
|
|
|
|
|
|