mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Refactor class methods
This commit is contained in:
parent
f2daaf75cf
commit
59b798a115
1 changed files with 7 additions and 7 deletions
|
@ -23,10 +23,10 @@ class Downloader(Configs):
|
|||
self.filename = None
|
||||
self.downloader_command: str = ''
|
||||
self.downloader_tools: dict = {
|
||||
'wget': self.wget_downloader,
|
||||
'wget2': self.wget_downloader,
|
||||
'curl': self.curl_downloader,
|
||||
'lftp': self.lftp_downloader
|
||||
'wget': self.set_wget_downloader,
|
||||
'wget2': self.set_wget_downloader,
|
||||
'curl': self.set_curl_downloader,
|
||||
'lftp': self.set_lftp_downloader
|
||||
}
|
||||
self.option_for_parallel: bool = self.utils.is_option(
|
||||
('-P', '--parallel'), flags)
|
||||
|
@ -78,14 +78,14 @@ class Downloader(Configs):
|
|||
except FileNotFoundError as error:
|
||||
self.errors.raise_error_message(f'{error}', 1)
|
||||
|
||||
def wget_downloader(self, url: str, path: Path) -> None:
|
||||
def set_wget_downloader(self, url: str, path: Path) -> None:
|
||||
self.downloader_command: str = f'{self.downloader} {self.wget_options} --directory-prefix={path} "{url}"'
|
||||
|
||||
def curl_downloader(self, url: str, path: Path) -> None:
|
||||
def set_curl_downloader(self, url: str, path: Path) -> None:
|
||||
self.downloader_command: str = (f'{self.downloader} {self.curl_options} "{url}" '
|
||||
f'--output {path}/{self.filename}')
|
||||
|
||||
def lftp_downloader(self, url: str, path: Path) -> None:
|
||||
def set_lftp_downloader(self, url: str, path: Path) -> None:
|
||||
self.downloader_command: str = f'{self.downloader} {self.lftp_get_options} {url} -o {path}'
|
||||
|
||||
def check_if_downloaded(self, url: str, path: Path) -> None:
|
||||
|
|
Loading…
Reference in a new issue