added wget option

This commit is contained in:
Dimitris Zlatanidis 2015-01-07 09:25:48 +02:00
parent 42bde2a32a
commit e16176b777
3 changed files with 13 additions and 3 deletions

View file

@ -73,3 +73,6 @@ DEL_DEPS=off
# Use colors for highlighting. Choose 'on' or 'off'.
USE_COLORS=on
# Wget [OPTIONS]. Pass wget option. Default is '-c -N'.
WGET_OPTION=-c -N

View file

@ -111,6 +111,7 @@ remove_deps_answer = "n"
skip_unst = "n"
del_deps = "on"
use_colors = "on"
wget_option = '-c -N'
if os.path.isfile("/etc/slpkg/slpkg.conf"):
f = open("/etc/slpkg/slpkg.conf", "r")
@ -148,6 +149,9 @@ if os.path.isfile("/etc/slpkg/slpkg.conf"):
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()
ktown_kde_repo = ktown_repo(repositories)
slacke_sub_repo = slacke_repo(repositories)

View file

@ -24,7 +24,10 @@
import sys
import subprocess
from __metadata__ import color
from __metadata__ import (
color,
wget_option
)
class Download(object):
@ -45,8 +48,8 @@ class Download(object):
color['ENDC'],
file_name))
try:
subprocess.call("wget -c -N --directory-prefix={0} {1}".format(
self.path, dwn), shell=True)
subprocess.call("wget {0} --directory-prefix={1} {2}".format(
wget_option, self.path, dwn), shell=True)
except KeyboardInterrupt:
print # new line at cancel
sys.exit(0)