Scrapy, a fast high-level web crawling & scraping framework for Python.
Some cleanup.
Andrey Rakhmatullin7ebb8256f029
diff --git a/docs/topics/addons.rst b/docs/topics/addons.rstindex ba6e839a5..b86058dc4 100644--- a/docs/topics/addons.rst+++ b/docs/topics/addons.rst@@ -43,7 +43,6 @@ case with one requiring no configuration) are enabled/configured in a project'sINSTALLED_ADDONS = ('httpcache','path.to.some.addon',- 'path/to/other/addon.py',)HTTPCACHE = {@@ -73,8 +72,6 @@ dictionary keys. I.e., the configuration from above would look like this:[addon:path.to.some.addon]some_config = true- [addon:path/to/other/addon.py]-Enabling and configuring add-ons within Python code---------------------------------------------------diff --git a/scrapy/addons.py b/scrapy/addons.pyindex 8f0f39889..43a36e5e5 100644--- a/scrapy/addons.py+++ b/scrapy/addons.py@@ -156,10 +156,10 @@ class AddonManager(Mapping):addons = AddonManager()# ... load some add-ons here- print addons.enabled # prints names of all enabled add-ons- print addons['TestAddon'].version # prints version of add-on with name+ print(addons.enabled) # prints names of all enabled add-ons+ print(addons['TestAddon'].version) # prints version of add-on with name# 'TestAddon'- print addons.configs['TestAddon'] # prints configuration of 'TestAddon'+ print(addons.configs['TestAddon']) # prints configuration of 'TestAddon'"""diff --git a/tests/test_addons/addonmod.py b/tests/test_addons/addonmod.pyindex c59f6737f..092c3c0eb 100644--- a/tests/test_addons/addonmod.py+++ b/tests/test_addons/addonmod.py@@ -1,10 +1,8 @@-import zope.interface+from zope.interface import moduleProvidesfrom scrapy.interfaces import IAddon-zope.interface.moduleProvides(IAddon)--FROM = "test_addons.addonmod"+moduleProvides(IAddon)name = "AddonModule"version = "1.0"diff --git a/tests/test_addons/addons.py b/tests/test_addons/addons.pyindex 4adb9fe8f..d878f37ea 100644--- a/tests/test_addons/addons.py+++ b/tests/test_addons/addons.py@@ -1,13 +1,9 @@-import zope.interface+from zope.interface import implementerfrom scrapy.interfaces import IAddon-class Addon(object):- FROM = "test_addons.addons"--[email protected](IAddon)+@implementer(IAddon)class GoodAddon(object):name = "GoodAddon"version = "1.0"@@ -28,7 +24,7 @@ class GoodAddon(object):pass[email protected](IAddon)+@implementer(IAddon)class BrokenAddon(object):name = "BrokenAddon"# No version