code adjustments according to pep8
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
import importlib
|
||||
|
||||
|
||||
def find(scheme):
|
||||
"""Return downloader class suitable for handling the given scheme"""
|
||||
try:
|
||||
@@ -21,6 +22,7 @@ def find(scheme):
|
||||
except ImportError:
|
||||
return None
|
||||
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# internals
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
import os
|
||||
|
||||
|
||||
class BasicDownloader():
|
||||
"""Base class for downloader modules"""
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
"""Downloader module for http urls"""
|
||||
"""Downloader module for http:// and https:// urls"""
|
||||
|
||||
import time
|
||||
import requests
|
||||
import mimetypes
|
||||
from .common import BasicDownloader
|
||||
|
||||
|
||||
class Downloader(BasicDownloader):
|
||||
|
||||
def __init__(self, output):
|
||||
@@ -38,7 +39,9 @@ class Downloader(BasicDownloader):
|
||||
if response.status_code != requests.codes.ok:
|
||||
tries += 1
|
||||
self.out.error(pathfmt.path, 'HTTP status "{} {}"'.format(
|
||||
response.status_code, response.reason), tries, self.max_tries)
|
||||
response.status_code, response.reason),
|
||||
tries, self.max_tries
|
||||
)
|
||||
if response.status_code == 404:
|
||||
return self.max_tries
|
||||
time.sleep(1)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
from .common import BasicDownloader
|
||||
|
||||
|
||||
class Downloader(BasicDownloader):
|
||||
|
||||
def __init__(self, output):
|
||||
|
||||
Reference in New Issue
Block a user