Commit 916e497e authored by Łukasz Nowak's avatar Łukasz Nowak

Reformatted with black

parent 24a1e7d4
......@@ -144,7 +144,14 @@ class WebBot:
for url in url_dict:
for ip in url_dict[url]:
checkHttpStatus(
self._db, status_id, url, ip, __version__, timeout, elapsed_fast, elapsed_moderate
self._db,
status_id,
url,
ip,
__version__,
timeout,
elapsed_fast,
elapsed_moderate,
)
# XXX Check location header and check new url recursively
# XXX Parse HTML, fetch found link, css, js, image
......
......@@ -133,7 +133,9 @@ def logHttpStatus(db, ip, url, code, total_seconds, fast, moderate, status_id):
(previous_entry is None)
or (previous_entry.status_code != code)
or (
calculateSpeedRange(previous_entry.total_seconds, fast, moderate)
calculateSpeedRange(
previous_entry.total_seconds, fast, moderate
)
!= calculateSpeedRange(total_seconds, fast, moderate)
)
):
......@@ -147,7 +149,16 @@ def logHttpStatus(db, ip, url, code, total_seconds, fast, moderate, status_id):
return previous_entry.status_id
def checkHttpStatus(db, status_id, url, ip, bot_version, timeout=TIMEOUT, elapsed_fast=ELAPSED_FAST, elapsed_moderate=ELAPSED_MODERATE):
def checkHttpStatus(
db,
status_id,
url,
ip,
bot_version,
timeout=TIMEOUT,
elapsed_fast=ELAPSED_FAST,
elapsed_moderate=ELAPSED_MODERATE,
):
parsed_url = urlparse(url)
hostname = parsed_url.hostname
request_kw = {"timeout": timeout}
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment