mirror of https://github.com/scrapy/scrapy.git
removed unneeded exception code
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40194
This commit is contained in:
parent
a88fb416c7
commit
41fa98801c
|
|
@ -1,10 +1,6 @@
|
|||
import re
|
||||
|
||||
class DuplicatedAdaptorName(Exception):
|
||||
def __init__(self, name):
|
||||
self.__name = name
|
||||
def __str__(self):
|
||||
return name
|
||||
class DuplicatedAdaptorName(Exception): pass
|
||||
|
||||
class Adaptor(object):
|
||||
"""
|
||||
|
|
@ -21,6 +17,7 @@ class Adaptor(object):
|
|||
return self.basefunction(value, **pipeargs)
|
||||
|
||||
class AdaptorPipe:
|
||||
|
||||
def __init__(self, define_from=None, adaptorclass=None):
|
||||
"""
|
||||
If "define_from" is given, constructs pipeline from this.
|
||||
|
|
@ -35,6 +32,7 @@ class AdaptorPipe:
|
|||
"""
|
||||
self.__adaptorspipe = []
|
||||
self.__adaptorclass = adaptorclass or Adaptor
|
||||
|
||||
@property
|
||||
def adaptors_names(self):
|
||||
_adaptors = []
|
||||
|
|
@ -70,4 +68,4 @@ class AdaptorPipe:
|
|||
for adaptor in self.__adaptorspipe:
|
||||
if adaptor.attribute_re.search(attrname):
|
||||
value = adaptor.function(value, **pipeargs)
|
||||
return value
|
||||
return value
|
||||
|
|
|
|||
Loading…
Reference in New Issue