mirror of https://github.com/scrapy/scrapy.git
moved scrapy.core.exceptions to scrapy.exceptions, keeping backwards compatibility
--HG-- rename : scrapy/core/exceptions.py => scrapy/exceptions.py
This commit is contained in:
parent
355c615c2c
commit
c359a34d7d
|
|
@ -84,7 +84,7 @@ single Python class that defines one or more of the following methods:
|
|||
callback, the response downloaded will be just passed to the original request
|
||||
callback.
|
||||
|
||||
If it returns an :exc:`~scrapy.core.exceptions.IgnoreRequest` exception, the
|
||||
If it returns an :exc:`~scrapy.exceptions.IgnoreRequest` exception, the
|
||||
entire request will be dropped completely and its callback never called.
|
||||
|
||||
:param request: the request being processed
|
||||
|
|
@ -96,13 +96,13 @@ single Python class that defines one or more of the following methods:
|
|||
.. method:: process_response(request, response, spider)
|
||||
|
||||
:meth:`process_response` should return a :class:`~scrapy.http.Response`
|
||||
object or raise a :exc:`~scrapy.core.exceptions.IgnoreRequest` exception.
|
||||
object or raise a :exc:`~scrapy.exceptions.IgnoreRequest` exception.
|
||||
|
||||
If it returns a :class:`~scrapy.http.Response` (it could be the same given
|
||||
response, or a brand-new one), that response will continue to be processed
|
||||
with the :meth:`process_response` of the next middleware in the pipeline.
|
||||
|
||||
If it returns an :exc:`~scrapy.core.exceptions.IgnoreRequest` exception, the
|
||||
If it returns an :exc:`~scrapy.exceptions.IgnoreRequest` exception, the
|
||||
response will be dropped completely and its callback never called.
|
||||
|
||||
:param request: the request that originated the response
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
Exceptions
|
||||
==========
|
||||
|
||||
.. module:: scrapy.core.exceptions
|
||||
:synopsis: Core exceptions
|
||||
.. module:: scrapy.exceptions
|
||||
:synopsis: Scrapy exceptions
|
||||
|
||||
.. _topics-exceptions-ref:
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ which doesn't need to implement any particular method.
|
|||
|
||||
All extension initialization code must be performed in the class constructor
|
||||
(``__init__`` method). If that method raises the
|
||||
:exc:`~scrapy.core.exceptions.NotConfigured` exception, the extension will be
|
||||
:exc:`~scrapy.exceptions.NotConfigured` exception, the extension will be
|
||||
disabled. Otherwise, the extension will be enabled.
|
||||
|
||||
Let's take a look at the following example extension which just logs a message
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ Here are the methods that you should override in your custom Images Pipeline:
|
|||
store the downloaded image paths (passed in results) in the ``image_paths``
|
||||
item field, and we drop the item if it doesn't contain any images::
|
||||
|
||||
from scrapy.core.exceptions import DropItem
|
||||
from scrapy.exceptions import DropItem
|
||||
|
||||
def item_completed(self, results, item, info):
|
||||
image_paths = [info['path'] for success, info in results if success]
|
||||
|
|
@ -153,7 +153,7 @@ Here is a full example of the Images Pipeline whose methods are examplified
|
|||
above::
|
||||
|
||||
from scrapy.contrib.pipeline.images import ImagesPipeline
|
||||
from scrapy.core.exceptions import DropItem
|
||||
from scrapy.exceptions import DropItem
|
||||
from scrapy.http import Request
|
||||
|
||||
class MyImagesPipeline(ImagesPipeline):
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ single Python class that must define the following method:
|
|||
|
||||
This method is called for every item pipeline component and must either return
|
||||
a :class:`~scrapy.item.Item` (or any descendant class) object or raise a
|
||||
:exc:`~scrapy.core.exceptions.DropItem` exception. Dropped items are no longer
|
||||
:exc:`~scrapy.exceptions.DropItem` exception. Dropped items are no longer
|
||||
processed by further pipeline components.
|
||||
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ Let's take a look at following hypothetic pipeline that adjusts the ``price``
|
|||
attribute for those items that do not include VAT (``price_excludes_vat``
|
||||
attribute), and drops those items which don't contain a price::
|
||||
|
||||
from scrapy.core.exceptions import DropItem
|
||||
from scrapy.exceptions import DropItem
|
||||
|
||||
class PricePipeline(object):
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ spider returns multiples items with the same id::
|
|||
|
||||
from scrapy.xlib.pydispatch import dispatcher
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.exceptions import DropItem
|
||||
from scrapy.exceptions import DropItem
|
||||
|
||||
class DuplicatesPipeline(object):
|
||||
def __init__(self):
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ item_dropped
|
|||
.. function:: item_dropped(item, spider, exception)
|
||||
|
||||
Sent after an item has been dropped from the :ref:`topics-item-pipeline`
|
||||
when some stage raised a :exc:`~scrapy.core.exceptions.DropItem` exception.
|
||||
when some stage raised a :exc:`~scrapy.exceptions.DropItem` exception.
|
||||
|
||||
:param item: the item dropped from the :ref:`topics-item-pipeline`
|
||||
:type item: :class:`~scrapy.item.Item` object
|
||||
|
|
@ -100,9 +100,9 @@ item_dropped
|
|||
:type spider: :class:`~scrapy.spider.BaseSpider` object
|
||||
|
||||
:param exception: the exception (which must be a
|
||||
:exc:`~scrapy.core.exceptions.DropItem` subclass) which caused the item
|
||||
:exc:`~scrapy.exceptions.DropItem` subclass) which caused the item
|
||||
to be dropped
|
||||
:type exception: :exc:`~scrapy.core.exceptions.DropItem` exception
|
||||
:type exception: :exc:`~scrapy.exceptions.DropItem` exception
|
||||
|
||||
spider_closed
|
||||
-------------
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
|
||||
# See: http://doc.scrapy.org/topics/item-pipeline.html
|
||||
|
||||
from scrapy.core.exceptions import DropItem
|
||||
from scrapy.exceptions import DropItem
|
||||
|
||||
class FilterWordsPipeline(object):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from scrapy.core.exceptions import DropItem
|
||||
from scrapy.exceptions import DropItem
|
||||
|
||||
class FilterWordsPipeline(object):
|
||||
"""A pipeline for filtering out items which contain certain words in their
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import cPickle as pickle
|
|||
from scrapy.xlib.pydispatch import dispatcher
|
||||
from scrapy.core import signals
|
||||
from scrapy.http import Headers
|
||||
from scrapy.core.exceptions import NotConfigured, IgnoreRequest
|
||||
from scrapy.exceptions import NotConfigured, IgnoreRequest
|
||||
from scrapy.core.downloader.responsetypes import responsetypes
|
||||
from scrapy.utils.request import request_fingerprint
|
||||
from scrapy.utils.http import headers_dict_to_raw, headers_raw_to_dict
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from urllib2 import _parse_proxy
|
|||
from urlparse import urlunparse
|
||||
|
||||
from scrapy.utils.httpobj import urlparse_cached
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
|
||||
|
||||
class HttpProxyMiddleware(object):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from scrapy import log
|
|||
from scrapy.http import HtmlResponse
|
||||
from scrapy.utils.url import urljoin_rfc
|
||||
from scrapy.utils.response import get_meta_refresh
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
from scrapy.conf import settings
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from scrapy.xlib.pydispatch import dispatcher
|
|||
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.manager import scrapymanager
|
||||
from scrapy.core.exceptions import NotConfigured, IgnoreRequest
|
||||
from scrapy.exceptions import NotConfigured, IgnoreRequest
|
||||
from scrapy.http import Request
|
||||
from scrapy.utils.httpobj import urlparse_cached
|
||||
from scrapy.conf import settings
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.utils.request import request_httprepr
|
||||
from scrapy.utils.response import response_httprepr
|
||||
from scrapy.stats import stats
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import cPickle as pickle
|
|||
from scrapy.xlib.pydispatch import dispatcher
|
||||
|
||||
from scrapy.core.manager import scrapymanager
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.core import signals
|
||||
from scrapy.utils.response import response_httprepr
|
||||
from scrapy.stats import stats
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import libxml2
|
|||
from scrapy.xlib.pydispatch import dispatcher
|
||||
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.mail import MailSender
|
||||
from scrapy.conf import settings
|
||||
from scrapy import log
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from scrapy.xlib.pydispatch import dispatcher
|
|||
from scrapy.core import signals
|
||||
from scrapy import log
|
||||
from scrapy.core.manager import scrapymanager
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.mail import MailSender
|
||||
from scrapy.conf import settings
|
||||
from scrapy.stats import stats
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ See documentation in docs/item-pipeline.rst
|
|||
"""
|
||||
|
||||
from scrapy import log
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.item import BaseItem
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.utils.defer import defer_succeed, mustbe_deferred
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ See documentation in docs/topics/item-pipeline.rst
|
|||
|
||||
from scrapy.xlib.pydispatch import dispatcher
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.contrib import exporter
|
||||
from scrapy.conf import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from scrapy import log
|
|||
from scrapy.stats import stats
|
||||
from scrapy.utils.misc import md5sum
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.exceptions import DropItem, NotConfigured, IgnoreRequest
|
||||
from scrapy.exceptions import DropItem, NotConfigured, IgnoreRequest
|
||||
from scrapy.contrib.pipeline.media import MediaPipeline
|
||||
from scrapy.conf import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ DuplicatesFilterMiddleware: Filter out already visited urls
|
|||
See documentation in docs/topics/scheduler-middleware.rst
|
||||
"""
|
||||
|
||||
from scrapy.core.exceptions import IgnoreRequest, NotConfigured
|
||||
from scrapy.exceptions import IgnoreRequest, NotConfigured
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.conf import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from collections import defaultdict
|
|||
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.manager import scrapymanager
|
||||
from scrapy.core.exceptions import NotConfigured, DontCloseSpider
|
||||
from scrapy.exceptions import NotConfigured, DontCloseSpider
|
||||
from scrapy.conf import settings
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ HttpError Spider Middleware
|
|||
|
||||
See documentation in docs/topics/spider-middleware.rst
|
||||
"""
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
|
||||
|
||||
class HttpError(IgnoreRequest):
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from scrapy.xlib.pydispatch import dispatcher
|
|||
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.manager import scrapymanager
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.conf import settings
|
||||
from scrapy.http import Request
|
||||
from scrapy import log
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ See documentation in docs/topics/spider-middleware.rst
|
|||
|
||||
from scrapy import log
|
||||
from scrapy.http import Request
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.conf import settings
|
||||
|
||||
class UrlLengthMiddleware(object):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from scrapy.item import BaseItem
|
|||
from scrapy.http import Request
|
||||
from scrapy.utils.iterators import xmliter, csviter
|
||||
from scrapy.selector import XmlXPathSelector, HtmlXPathSelector
|
||||
from scrapy.core.exceptions import NotConfigured, NotSupported
|
||||
from scrapy.exceptions import NotConfigured, NotSupported
|
||||
|
||||
class XMLFeedSpider(InitSpider):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from scrapy.xlib.pydispatch import dispatcher
|
|||
from scrapy.stats import stats, signals
|
||||
from scrapy.mail import MailSender
|
||||
from scrapy.conf import settings
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
|
||||
class StatsMailer(object):
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""Download handlers for different schemes"""
|
||||
|
||||
from scrapy.core.exceptions import NotSupported
|
||||
from scrapy.exceptions import NotSupported
|
||||
from scrapy.utils.httpobj import urlparse_cached
|
||||
from scrapy.conf import settings
|
||||
from scrapy.utils.misc import load_object
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
from twisted.internet import reactor
|
||||
|
||||
from scrapy.core import signals
|
||||
from scrapy.core.exceptions import NotSupported
|
||||
from scrapy.exceptions import NotSupported
|
||||
from scrapy.utils.signal import send_catch_log
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.conf import settings
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from time import time
|
|||
from twisted.internet import reactor, defer
|
||||
from twisted.python.failure import Failure
|
||||
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
from scrapy.conf import settings
|
||||
from scrapy.utils.defer import mustbe_deferred
|
||||
from scrapy import log
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from scrapy.core import signals
|
|||
from scrapy.utils.signal import send_catch_log
|
||||
from scrapy import log
|
||||
from scrapy.http import Request, Response
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.utils.defer import mustbe_deferred
|
||||
from scrapy.utils.conf import build_component_list
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ from scrapy.conf import settings
|
|||
from scrapy.core import signals
|
||||
from scrapy.core.downloader import Downloader
|
||||
from scrapy.core.scraper import Scraper
|
||||
from scrapy.core.exceptions import IgnoreRequest, DontCloseSpider
|
||||
from scrapy.exceptions import IgnoreRequest, DontCloseSpider
|
||||
from scrapy.http import Response, Request
|
||||
from scrapy.spider import spiders
|
||||
from scrapy.utils.misc import load_object
|
||||
|
|
|
|||
|
|
@ -1,40 +1,5 @@
|
|||
"""
|
||||
Scrapy core exceptions
|
||||
from scrapy.exceptions import *
|
||||
|
||||
These exceptions are documented in docs/topics/exceptions.rst. Please don't add
|
||||
new exceptions here without documenting them there.
|
||||
"""
|
||||
|
||||
from scrapy import log
|
||||
|
||||
# Internal
|
||||
|
||||
class NotConfigured(Exception):
|
||||
"""Indicates a missing configuration situation"""
|
||||
pass
|
||||
|
||||
# HTTP and crawling
|
||||
|
||||
class IgnoreRequest(Exception):
|
||||
"""Indicates a decision was made not to process a request"""
|
||||
|
||||
def __init__(self, msg='', level=log.ERROR):
|
||||
self.msg = msg
|
||||
self.level = level
|
||||
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
|
||||
class DontCloseSpider(Exception):
|
||||
"""Request the spider not to be closed yet"""
|
||||
pass
|
||||
|
||||
# Items
|
||||
|
||||
class DropItem(Exception):
|
||||
"""Drop item from the item pipeline"""
|
||||
pass
|
||||
|
||||
class NotSupported(Exception):
|
||||
"""Indicates a feature or method is not supported"""
|
||||
pass
|
||||
import warnings
|
||||
warnings.warn("scrapy.core.exceptions is deprecated, use scrapy.exceptions instead", \
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from twisted.python.failure import Failure
|
|||
|
||||
from scrapy.utils.datatypes import PriorityQueue, PriorityStack
|
||||
from scrapy.core.schedulermw import SchedulerMiddlewareManager
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
from scrapy.conf import settings
|
||||
|
||||
class Scheduler(object):
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from collections import defaultdict
|
|||
from twisted.internet.defer import Deferred
|
||||
|
||||
from scrapy import log
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.utils.defer import mustbe_deferred
|
||||
from scrapy.utils.conf import build_component_list
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from scrapy.utils.defer import defer_result, defer_succeed, parallel
|
|||
from scrapy.utils.spider import iterate_spider_output
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.utils.signal import send_catch_log
|
||||
from scrapy.core.exceptions import IgnoreRequest, DropItem
|
||||
from scrapy.exceptions import IgnoreRequest, DropItem
|
||||
from scrapy.core import signals
|
||||
from scrapy.http import Request, Response
|
||||
from scrapy.item import BaseItem
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ docs/topics/spider-middleware.rst
|
|||
|
||||
from scrapy import log
|
||||
from twisted.python.failure import Failure
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.utils.conf import build_component_list
|
||||
from scrapy.utils.defer import mustbe_deferred
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
"""
|
||||
Scrapy core exceptions
|
||||
|
||||
These exceptions are documented in docs/topics/exceptions.rst. Please don't add
|
||||
new exceptions here without documenting them there.
|
||||
"""
|
||||
|
||||
from scrapy import log
|
||||
|
||||
# Internal
|
||||
|
||||
class NotConfigured(Exception):
|
||||
"""Indicates a missing configuration situation"""
|
||||
pass
|
||||
|
||||
# HTTP and crawling
|
||||
|
||||
class IgnoreRequest(Exception):
|
||||
"""Indicates a decision was made not to process a request"""
|
||||
|
||||
def __init__(self, msg='', level=log.ERROR):
|
||||
self.msg = msg
|
||||
self.level = level
|
||||
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
|
||||
class DontCloseSpider(Exception):
|
||||
"""Request the spider not to be closed yet"""
|
||||
pass
|
||||
|
||||
# Items
|
||||
|
||||
class DropItem(Exception):
|
||||
"""Drop item from the item pipeline"""
|
||||
pass
|
||||
|
||||
class NotSupported(Exception):
|
||||
"""Indicates a feature or method is not supported"""
|
||||
pass
|
||||
|
|
@ -3,7 +3,7 @@ This module contains the ExtensionManager which takes care of loading and
|
|||
keeping track of all enabled extensions. It also contains an instantiated
|
||||
ExtensionManager (extensions) to be used as singleton.
|
||||
"""
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.utils.misc import load_object
|
||||
from scrapy.utils.conf import build_component_list
|
||||
from scrapy import log
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ from twisted.internet import defer, reactor
|
|||
from twisted.mail.smtp import ESMTPSenderFactory
|
||||
|
||||
from scrapy import log
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.conf import settings
|
||||
from scrapy.utils.signal import send_catch_log
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from twisted.conch.insults import insults
|
|||
from twisted.internet import reactor, protocol
|
||||
|
||||
from scrapy.extension import extensions
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.core.manager import scrapymanager
|
||||
from scrapy.spider import spiders
|
||||
from scrapy.stats import stats
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from scrapy.http import Response, HtmlResponse, Request
|
|||
from scrapy.spider import BaseSpider
|
||||
from scrapy.contrib.downloadermiddleware.httpcache import FilesystemCacheStorage, HttpCacheMiddleware
|
||||
from scrapy.conf import Settings
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
|
||||
|
||||
class HttpCacheMiddlewareTest(unittest.TestCase):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import sys
|
|||
from twisted.trial.unittest import TestCase, SkipTest
|
||||
|
||||
from scrapy.contrib.downloadermiddleware.httpproxy import HttpProxyMiddleware
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.http import Response, Request
|
||||
from scrapy.spider import BaseSpider
|
||||
from scrapy.conf import settings
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import unittest
|
|||
|
||||
from scrapy.contrib.downloadermiddleware.redirect import RedirectMiddleware
|
||||
from scrapy.spider import BaseSpider
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
from scrapy.http import Request, Response, HtmlResponse, Headers
|
||||
|
||||
class RedirectMiddlewareTest(unittest.TestCase):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import unittest
|
|||
|
||||
from scrapy.http import Request
|
||||
from scrapy.spider import BaseSpider
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
from scrapy.contrib.schedulermiddleware.duplicatesfilter import DuplicatesFilterMiddleware
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Helper functions for dealing with Twisted deferreds
|
|||
from twisted.internet import defer, reactor, task
|
||||
from twisted.python import failure
|
||||
|
||||
from scrapy.core.exceptions import IgnoreRequest
|
||||
from scrapy.exceptions import IgnoreRequest
|
||||
|
||||
def defer_fail(_failure):
|
||||
"""Same as twisted.internet.defer.fail, but delay calling errback until
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ See docs/topics/ws.rst
|
|||
from twisted.internet import reactor
|
||||
from twisted.web import server, resource, error
|
||||
|
||||
from scrapy.core.exceptions import NotConfigured
|
||||
from scrapy.exceptions import NotConfigured
|
||||
from scrapy.utils.jsonrpc import jsonrpc_server_call
|
||||
from scrapy.utils.serialize import ScrapyJSONEncoder, ScrapyJSONDecoder
|
||||
from scrapy.utils.misc import load_object
|
||||
|
|
|
|||
Loading…
Reference in New Issue