Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

removed unneeded exception code

Pablo Hoffman41fa98801c01
diff --git a/scrapy/trunk/scrapy/item/adaptors.py b/scrapy/trunk/scrapy/item/adaptors.py
index f77cab84d..eec3e94ef 100644
--- a/scrapy/trunk/scrapy/item/adaptors.py
+++ b/scrapy/trunk/scrapy/item/adaptors.py
@@ -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
\ No newline at end of file
+ return value