remove wrong import from decobot and added unquote_html

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40125
This commit is contained in:
olveyra 2008-07-27 02:49:20 +00:00
parent 137ec64318
commit 1e2ddb47a3
1 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,6 @@ from twisted.python import failure
from scrapy.core.exceptions import UsageError
from scrapy.utils.python import flatten
from decobot.utils.text_extraction import unquote_html
def dict_updatedefault(D, E, **F):
"""
@ -155,6 +154,13 @@ def load_class(class_path):
return cls
def unquote_html(s, keep_reserved=False):
"""Convert a HTML quoted string into normal string (ISO-8859-1).
Works with &#XX; and with   > etc.
"""
return re.sub(re.compile(r'&(#?)(.+?);', re.U), lambda m: convert_entity(m, keep_reserved), s)
def extract_regex(regex, text, encoding):
"""Extract a list of unicode strings from the given text/encoding using the following policies: