code adjustments according to pep8

This commit is contained in:
Mike Fährmann
2017-01-30 19:40:15 +01:00
parent 8e93633319
commit 4f123b8513
19 changed files with 103 additions and 34 deletions

View File

@@ -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

View File

@@ -10,6 +10,7 @@
import os
class BasicDownloader():
"""Base class for downloader modules"""

View File

@@ -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)

View File

@@ -10,6 +10,7 @@
from .common import BasicDownloader
class Downloader(BasicDownloader):
def __init__(self, output):