mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Update docstrings
This commit is contained in:
parent
1624724024
commit
b6ad26f7a6
1 changed files with 9 additions and 12 deletions
|
@ -15,10 +15,7 @@ from slpkg.views.views import View
|
|||
|
||||
|
||||
class Downloader(Configs): # pylint: disable=[R0902]
|
||||
|
||||
"""
|
||||
Downloads the sources using external tools.
|
||||
"""
|
||||
"""Downloads the sources using external tools."""
|
||||
|
||||
def __init__(self, flags: list):
|
||||
super(Configs, self).__init__()
|
||||
|
@ -44,14 +41,14 @@ class Downloader(Configs): # pylint: disable=[R0902]
|
|||
('-P', '--parallel'), flags)
|
||||
|
||||
def download(self, sources: dict) -> None:
|
||||
""" Starting the processing for downloading. """
|
||||
"""Starting the processing for downloading."""
|
||||
if self.parallel_downloads or self.option_for_parallel:
|
||||
self.parallel_download(sources)
|
||||
else:
|
||||
self.normal_download(sources)
|
||||
|
||||
def parallel_download(self, sources: dict) -> None:
|
||||
""" Download sources with parallel mode. """
|
||||
"""Download sources with parallel mode."""
|
||||
processes: list = []
|
||||
for urls, path in sources.values():
|
||||
for url in urls:
|
||||
|
@ -63,13 +60,13 @@ class Downloader(Configs): # pylint: disable=[R0902]
|
|||
process.join()
|
||||
|
||||
def normal_download(self, sources: dict) -> None:
|
||||
""" Download sources with normal mode. """
|
||||
"""Download sources with normal mode."""
|
||||
for urls, path in sources.values():
|
||||
for url in urls:
|
||||
self.tools(url, path)
|
||||
|
||||
def tools(self, url: str, path: Path) -> None:
|
||||
""" Run the tool to downloading.
|
||||
"""Run the tool to downloading.
|
||||
|
||||
Args:
|
||||
url (str): The URL link.
|
||||
|
@ -89,7 +86,7 @@ class Downloader(Configs): # pylint: disable=[R0902]
|
|||
self.semaphore.release()
|
||||
|
||||
def set_wget_downloader(self, url: str, path: Path) -> None:
|
||||
""" Set for wget tool.
|
||||
"""Set for wget tool.
|
||||
|
||||
Args:
|
||||
url (str): URL link.
|
||||
|
@ -98,7 +95,7 @@ class Downloader(Configs): # pylint: disable=[R0902]
|
|||
self.downloader_command: str = f'{self.downloader} {self.wget_options} --directory-prefix={path} "{url}"'
|
||||
|
||||
def set_curl_downloader(self, url: str, path: Path) -> None:
|
||||
""" Set for curl tool.
|
||||
"""Set for curl tool.
|
||||
|
||||
Args:
|
||||
url (str): URL link.
|
||||
|
@ -108,7 +105,7 @@ class Downloader(Configs): # pylint: disable=[R0902]
|
|||
f'--output {path}/{self.filename}')
|
||||
|
||||
def set_lftp_downloader(self, url: str, path: Path) -> None:
|
||||
""" Set for lftp tool.
|
||||
"""Set for lftp tool.
|
||||
|
||||
Args:
|
||||
url (str): URL link.
|
||||
|
@ -117,7 +114,7 @@ class Downloader(Configs): # pylint: disable=[R0902]
|
|||
self.downloader_command: str = f'{self.downloader} {self.lftp_get_options} {url} -o {path}'
|
||||
|
||||
def check_if_downloaded(self, url: str, path: Path) -> None:
|
||||
""" Checking if file downloaded.
|
||||
"""Checking if file downloaded.
|
||||
|
||||
Args:
|
||||
url (str): URL link.
|
||||
|
|
Loading…
Reference in a new issue