mirror of https://github.com/scrapy/scrapy.git
Fixed some little bugs in adaptors
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40411
This commit is contained in:
parent
3cbfb554d2
commit
68e497e532
|
|
@ -69,7 +69,7 @@ def adaptize(adaptor, my_args=None):
|
|||
else:
|
||||
my_args = []
|
||||
|
||||
def _adaptor(value, **adaptor_args):
|
||||
def _adaptor(value, adaptor_args):
|
||||
kwargs = dict((key, val) for key, val in adaptor_args.items() if key in my_args)
|
||||
return adaptor(value, **kwargs)
|
||||
return _adaptor
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ class ScrapedItem(object):
|
|||
self.set_attrib_adaptors(attrib, pipe)
|
||||
|
||||
def attribute(self, attrname, value, **kwargs):
|
||||
override = kwargs.pop('override', False)
|
||||
add = kwargs.pop('add', False)
|
||||
pipe = self._adaptors_dict.get(attrname)
|
||||
if pipe:
|
||||
val = pipe(value, **kwargs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue