mirror of https://github.com/scrapy/scrapy.git
Flake8: remove E127 (continuation line over-indented for visual indent)
This commit is contained in:
parent
17c0cf64ae
commit
49e8a337f7
10
pytest.ini
10
pytest.ini
|
|
@ -41,13 +41,13 @@ flake8-ignore =
|
||||||
scrapy/commands/runspider.py E501
|
scrapy/commands/runspider.py E501
|
||||||
scrapy/commands/settings.py E128
|
scrapy/commands/settings.py E128
|
||||||
scrapy/commands/shell.py E128 E501
|
scrapy/commands/shell.py E128 E501
|
||||||
scrapy/commands/startproject.py E127 E501 E128
|
scrapy/commands/startproject.py E501 E128
|
||||||
scrapy/commands/version.py E501 E128
|
scrapy/commands/version.py E501 E128
|
||||||
# scrapy/contracts
|
# scrapy/contracts
|
||||||
scrapy/contracts/__init__.py E501
|
scrapy/contracts/__init__.py E501
|
||||||
scrapy/contracts/default.py E128
|
scrapy/contracts/default.py E128
|
||||||
# scrapy/core
|
# scrapy/core
|
||||||
scrapy/core/engine.py E501 E128 E127
|
scrapy/core/engine.py E501 E128
|
||||||
scrapy/core/scheduler.py E501
|
scrapy/core/scheduler.py E501
|
||||||
scrapy/core/scraper.py E501 E128
|
scrapy/core/scraper.py E501 E128
|
||||||
scrapy/core/spidermw.py E501 E126
|
scrapy/core/spidermw.py E501 E126
|
||||||
|
|
@ -57,7 +57,7 @@ flake8-ignore =
|
||||||
scrapy/core/downloader/tls.py E501
|
scrapy/core/downloader/tls.py E501
|
||||||
scrapy/core/downloader/webclient.py E501 E128 E126
|
scrapy/core/downloader/webclient.py E501 E128 E126
|
||||||
scrapy/core/downloader/handlers/__init__.py E501
|
scrapy/core/downloader/handlers/__init__.py E501
|
||||||
scrapy/core/downloader/handlers/ftp.py E501 E128 E127
|
scrapy/core/downloader/handlers/ftp.py E501 E128
|
||||||
scrapy/core/downloader/handlers/http10.py E501
|
scrapy/core/downloader/handlers/http10.py E501
|
||||||
scrapy/core/downloader/handlers/http11.py E501
|
scrapy/core/downloader/handlers/http11.py E501
|
||||||
scrapy/core/downloader/handlers/s3.py E501 E128 E126
|
scrapy/core/downloader/handlers/s3.py E501 E128 E126
|
||||||
|
|
@ -124,7 +124,7 @@ flake8-ignore =
|
||||||
scrapy/utils/datatypes.py E501
|
scrapy/utils/datatypes.py E501
|
||||||
scrapy/utils/decorators.py E501
|
scrapy/utils/decorators.py E501
|
||||||
scrapy/utils/defer.py E501 E128
|
scrapy/utils/defer.py E501 E128
|
||||||
scrapy/utils/deprecate.py E128 E501 E127
|
scrapy/utils/deprecate.py E501
|
||||||
scrapy/utils/gz.py E501
|
scrapy/utils/gz.py E501
|
||||||
scrapy/utils/http.py F403
|
scrapy/utils/http.py F403
|
||||||
scrapy/utils/httpobj.py E501
|
scrapy/utils/httpobj.py E501
|
||||||
|
|
@ -137,7 +137,7 @@ flake8-ignore =
|
||||||
scrapy/utils/python.py E501
|
scrapy/utils/python.py E501
|
||||||
scrapy/utils/reactor.py E501
|
scrapy/utils/reactor.py E501
|
||||||
scrapy/utils/reqser.py E501
|
scrapy/utils/reqser.py E501
|
||||||
scrapy/utils/request.py E127 E501
|
scrapy/utils/request.py E501
|
||||||
scrapy/utils/response.py E501 E128
|
scrapy/utils/response.py E501 E128
|
||||||
scrapy/utils/signal.py E501 E128
|
scrapy/utils/signal.py E501 E128
|
||||||
scrapy/utils/sitemap.py E501
|
scrapy/utils/sitemap.py E501
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,12 @@ class FTPDownloadHandler:
|
||||||
def gotClient(self, client, request, filepath):
|
def gotClient(self, client, request, filepath):
|
||||||
self.client = client
|
self.client = client
|
||||||
protocol = ReceivedDataProtocol(request.meta.get("ftp_local_filename"))
|
protocol = ReceivedDataProtocol(request.meta.get("ftp_local_filename"))
|
||||||
return client.retrieveFile(filepath, protocol)\
|
return client.retrieveFile(filepath, protocol).addCallbacks(
|
||||||
.addCallbacks(callback=self._build_response,
|
callback=self._build_response,
|
||||||
callbackArgs=(request, protocol),
|
callbackArgs=(request, protocol),
|
||||||
errback=self._failed,
|
errback=self._failed,
|
||||||
errbackArgs=(request,))
|
errbackArgs=(request,),
|
||||||
|
)
|
||||||
|
|
||||||
def _build_response(self, result, request, protocol):
|
def _build_response(self, result, request, protocol):
|
||||||
self.result = result
|
self.result = result
|
||||||
|
|
|
||||||
|
|
@ -230,8 +230,7 @@ class ExecutionEngine:
|
||||||
|
|
||||||
def _downloaded(self, response, slot, request, spider):
|
def _downloaded(self, response, slot, request, spider):
|
||||||
slot.remove_request(request)
|
slot.remove_request(request)
|
||||||
return self.download(response, spider) \
|
return self.download(response, spider) if isinstance(response, Request) else response
|
||||||
if isinstance(response, Request) else response
|
|
||||||
|
|
||||||
def _download(self, request, spider):
|
def _download(self, request, spider):
|
||||||
slot = self.slot
|
slot = self.slot
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,17 @@ def attribute(obj, oldattr, newattr, version='0.12'):
|
||||||
stacklevel=3)
|
stacklevel=3)
|
||||||
|
|
||||||
|
|
||||||
def create_deprecated_class(name, new_class, clsdict=None,
|
def create_deprecated_class(
|
||||||
warn_category=ScrapyDeprecationWarning,
|
name,
|
||||||
warn_once=True,
|
new_class,
|
||||||
old_class_path=None,
|
clsdict=None,
|
||||||
new_class_path=None,
|
warn_category=ScrapyDeprecationWarning,
|
||||||
subclass_warn_message="{cls} inherits from "
|
warn_once=True,
|
||||||
"deprecated class {old}, please inherit "
|
old_class_path=None,
|
||||||
"from {new}.",
|
new_class_path=None,
|
||||||
instance_warn_message="{cls} is deprecated, "
|
subclass_warn_message="{cls} inherits from deprecated class {old}, please inherit from {new}.",
|
||||||
"instantiate {new} instead."):
|
instance_warn_message="{cls} is deprecated, instantiate {new} instead."
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Return a "deprecated" class that causes its subclasses to issue a warning.
|
Return a "deprecated" class that causes its subclasses to issue a warning.
|
||||||
Subclasses of ``new_class`` are considered subclasses of this class.
|
Subclasses of ``new_class`` are considered subclasses of this class.
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,7 @@ def request_fingerprint(request, include_headers=None, keep_fragments=False):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if include_headers:
|
if include_headers:
|
||||||
include_headers = tuple(to_bytes(h.lower())
|
include_headers = tuple(to_bytes(h.lower()) for h in sorted(include_headers))
|
||||||
for h in sorted(include_headers))
|
|
||||||
cache = _fingerprint_cache.setdefault(request, {})
|
cache = _fingerprint_cache.setdefault(request, {})
|
||||||
cache_key = (include_headers, keep_fragments)
|
cache_key = (include_headers, keep_fragments)
|
||||||
if cache_key not in cache:
|
if cache_key not in cache:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue