Scrapy, a fast high-level web crawling & scraping framework for Python.
Removed unused imports, and use crawler.settings instead of scrapy.conf.settings in Scrapy Shell
Pablo Hoffman622834bc089d
diff --git a/scrapy/shell.py b/scrapy/shell.pyindex a2bd5d7a3..5c245bbe3 100644--- a/scrapy/shell.py+++ b/scrapy/shell.py@@ -7,9 +7,7 @@ See documentation in docs/topics/shell.rstimport signalfrom twisted.internet import reactor, threads-from twisted.python.failure import Failure-from scrapy import logfrom scrapy.item import BaseItemfrom scrapy.spider import BaseSpiderfrom scrapy.selector import XPathSelector, XmlXPathSelector, HtmlXPathSelector@@ -18,7 +16,6 @@ from scrapy.utils.misc import load_objectfrom scrapy.utils.response import open_in_browserfrom scrapy.utils.url import any_to_urifrom scrapy.utils.console import start_python_console-from scrapy.conf import settingsfrom scrapy.settings import Settingsfrom scrapy.http import Request, Response, TextResponse@@ -31,7 +28,7 @@ class Shell(object):self.crawler = crawlerself.vars = {}self.update_vars = update_vars or (lambda x: None)- self.item_class = load_object(settings['DEFAULT_ITEM_CLASS'])+ self.item_class = load_object(crawler.settings['DEFAULT_ITEM_CLASS'])self.inthread = inthreadself.code = code@@ -81,7 +78,7 @@ class Shell(object):def populate_vars(self, url=None, response=None, request=None, spider=None):item = self.item_class()self.vars['item'] = item- self.vars['settings'] = settings+ self.vars['settings'] = self.crawler.settingsif url:if isinstance(response, TextResponse):self.vars['xxs'] = XmlXPathSelector(response)