PEP8 adjustments for scrapy.http.response module

This commit is contained in:
Eugenio Lacuesta 2019-11-20 09:55:15 -03:00
parent 48223c107a
commit 6f4e84ecf9
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
4 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,8 @@ responses in Scrapy.
See documentation in docs/topics/request-response.rst
"""
from typing import Generator
from six.moves.urllib.parse import urljoin
from scrapy.http.request import Request
@ -41,8 +43,8 @@ class Response(object_ref):
if isinstance(url, str):
self._url = url
else:
raise TypeError('%s url must be str, got %s:' % (type(self).__name__,
type(url).__name__))
raise TypeError('%s url must be str, got %s:' %
(type(self).__name__, type(url).__name__))
url = property(_get_url, obsolete_setter(_set_url, 'url'))

View File

@ -7,5 +7,6 @@ See documentation in docs/topics/request-response.rst
from scrapy.http.response.text import TextResponse
class HtmlResponse(TextResponse):
pass

View File

@ -6,6 +6,7 @@ See documentation in docs/topics/request-response.rst
"""
from contextlib import suppress
from typing import Generator
import parsel
import six
@ -14,6 +15,7 @@ from w3lib.encoding import (html_body_declared_encoding, html_to_unicode,
http_content_type_encoding, resolve_encoding)
from w3lib.html import strip_html5_whitespace
from scrapy.http import Request
from scrapy.http.response import Response
from scrapy.utils.python import memoizemethod_noargs, to_unicode
from scrapy.utils.response import get_base_url

View File

@ -7,5 +7,6 @@ See documentation in docs/topics/request-response.rst
from scrapy.http.response.text import TextResponse
class XmlResponse(TextResponse):
pass