Style adjustments by flake8
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
[flake8]
|
[flake8]
|
||||||
ignore = E501 # line too long
|
ignore = E501, F401
|
||||||
exclude = .git,__pycache__,docs,.github,build,dist
|
exclude = .git,.venv,__pycache__,docs,.github,build,dist,tests,benchmarks.py
|
||||||
@@ -11,12 +11,12 @@ from lxml import html
|
|||||||
|
|
||||||
html_forbidden = {html.HtmlComment, }
|
html_forbidden = {html.HtmlComment, }
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.ERROR,
|
level=logging.ERROR,
|
||||||
format='%(asctime)s - %(levelname)s - %(message)s',
|
format='%(asctime)s - %(levelname)s - %(message)s',
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.StreamHandler()
|
logging.StreamHandler()
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def is_jsonable(content: Union[bytes, str]) -> bool:
|
def is_jsonable(content: Union[bytes, str]) -> bool:
|
||||||
@@ -94,7 +94,7 @@ class _StorageTools:
|
|||||||
parent = element.getparent()
|
parent = element.getparent()
|
||||||
return tuple(
|
return tuple(
|
||||||
(element.tag,) if parent is None else (
|
(element.tag,) if parent is None else (
|
||||||
cls._get_element_path(parent) + (element.tag,)
|
cls._get_element_path(parent) + (element.tag,)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ def construct_proxy_dict(proxy_string: Union[str, Dict[str, str]]) -> Union[Dict
|
|||||||
}
|
}
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# Urllib will say that one of the parameters above can't be casted to the correct type like `int` for port etc...
|
# Urllib will say that one of the parameters above can't be casted to the correct type like `int` for port etc...
|
||||||
raise TypeError(f'The proxy argument\'s string is in invalid format!')
|
raise TypeError('The proxy argument\'s string is in invalid format!')
|
||||||
|
|
||||||
elif isinstance(proxy_string, dict):
|
elif isinstance(proxy_string, dict):
|
||||||
valid_keys = ('server', 'username', 'password', )
|
valid_keys = ('server', 'username', 'password', )
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|||||||
setup(
|
setup(
|
||||||
name="scrapling",
|
name="scrapling",
|
||||||
version="0.2.7",
|
version="0.2.7",
|
||||||
description="""Scrapling is a powerful, flexible, and high-performance web scraping library for Python. It
|
description="""Scrapling is a powerful, flexible, and high-performance web scraping library for Python. It
|
||||||
simplifies the process of extracting data from websites, even when they undergo structural changes, and offers
|
simplifies the process of extracting data from websites, even when they undergo structural changes, and offers
|
||||||
impressive speed improvements over many popular scraping tools.""",
|
impressive speed improvements over many popular scraping tools.""",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
author="Karim Shoair",
|
author="Karim Shoair",
|
||||||
|
|||||||
Reference in New Issue
Block a user