From 643ea99f367beb5d4c86fb5495e59d9a665f741d Mon Sep 17 00:00:00 2001 From: olveyra Date: Wed, 20 Aug 2008 12:52:31 +0000 Subject: [PATCH] fixed a clean code movement error: forget to apply remove tags when text does not contains cdata --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40175 --- scrapy/trunk/scrapy/contrib/adaptors.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scrapy/trunk/scrapy/contrib/adaptors.py b/scrapy/trunk/scrapy/contrib/adaptors.py index 040b84fdb..7878b56d7 100644 --- a/scrapy/trunk/scrapy/contrib/adaptors.py +++ b/scrapy/trunk/scrapy/contrib/adaptors.py @@ -30,7 +30,7 @@ class ExtendedAdaptor(BaseAdaptor): class ExtractAdaptor(ExtendedAdaptor): - def function(self, item, location, **pipeargs): + def function(self, attrname, location, **pipeargs): return self.do(self.extract, location, **pipeargs) def extract(self, location, **kwargs): @@ -75,7 +75,7 @@ _xml_cdata_split_re = re.compile('()', re.S) class HtmlCleanAdaptor(ExtendedAdaptor): - def function(self, item, location, **pipeargs): + def function(self, attrname, string, **pipeargs): return self.do(self.clean, string, **pipeargs) def clean(self, string, **kwargs): @@ -121,4 +121,6 @@ class XmlCleanAdaptor(HtmlCleanAdaptor): pieces.append(HtmlCleanAdaptor._remove_tags(self, piece, **kwargs)) xml = "".join(pieces) + else: + xml = HtmlCleanAdaptor._remove_tags(self, xml, **kwargs) return xml