mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
update wget options
This commit is contained in:
parent
61b1817e23
commit
6568b00566
4 changed files with 10 additions and 8 deletions
|
@ -75,4 +75,4 @@ DEL_DEPS=off
|
|||
USE_COLORS=on
|
||||
|
||||
# Wget [OPTION]. Pass wget options. Default is '-c -N'.
|
||||
WGET_OPTION=-c -N
|
||||
WGET_OPTIONS=-c -N
|
||||
|
|
|
@ -125,7 +125,7 @@ class MetaData(object):
|
|||
skip_unst = "n"
|
||||
del_deps = "off"
|
||||
use_colors = "on"
|
||||
wget_option = '-c -N'
|
||||
wget_options = '-c -N'
|
||||
|
||||
if os.path.isfile(conf_path + "slpkg.conf"):
|
||||
f = open(conf_path + "slpkg.conf", "r")
|
||||
|
@ -163,8 +163,8 @@ class MetaData(object):
|
|||
del_deps = line[9:].strip()
|
||||
if line.startswith("USE_COLORS"):
|
||||
use_colors = line[11:].strip()
|
||||
if line.startswith("WGET_OPTION"):
|
||||
wget_option = line[12:].strip()
|
||||
if line.startswith("WGET_OPTIONS"):
|
||||
wget_options = line[13:].strip()
|
||||
|
||||
ktown_kde_repo = ktown_repo(repositories)
|
||||
slacke_sub_repo = slacke_repo(repositories)
|
||||
|
|
|
@ -52,7 +52,7 @@ class Config(object):
|
|||
'SKIP_UNST',
|
||||
'DEL_DEPS',
|
||||
'USE_COLORS',
|
||||
'WGET_OPTION'
|
||||
'WGET_OPTIONS'
|
||||
]
|
||||
read_conf = Utils().read_file(self.config_file)
|
||||
for line in read_conf.splitlines():
|
||||
|
|
|
@ -34,6 +34,7 @@ class Download(object):
|
|||
def __init__(self, path, url):
|
||||
self.path = path
|
||||
self.url = url
|
||||
self.wget_options = _m.wget_options
|
||||
|
||||
def start(self):
|
||||
'''
|
||||
|
@ -46,14 +47,15 @@ class Download(object):
|
|||
self.file_name))
|
||||
try:
|
||||
subprocess.call("wget {0} --directory-prefix={1} {2}".format(
|
||||
_m.wget_option, self.path, dwn), shell=True)
|
||||
self.check()
|
||||
self.wget_options, self.path, dwn), shell=True)
|
||||
self._check_if_downloaded()
|
||||
except KeyboardInterrupt:
|
||||
print # new line at cancel
|
||||
sys.exit(0)
|
||||
|
||||
def check(self):
|
||||
def _check_if_downloaded(self):
|
||||
if not os.path.isfile(self.path + self.file_name):
|
||||
print('')
|
||||
Msg().template(78)
|
||||
print("| Download '{0}' file {1}[ FAILED ]{2}".format(
|
||||
self.file_name, _m.color['RED'], _m.color['ENDC']))
|
||||
|
|
Loading…
Reference in a new issue