From e16176b7776e382836be1a1bae3073916ce1e3b4 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 7 Jan 2015 09:25:48 +0200 Subject: [PATCH] added wget option --- conf/slpkg.conf | 3 +++ slpkg/__metadata__.py | 4 ++++ slpkg/downloader.py | 9 ++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/conf/slpkg.conf b/conf/slpkg.conf index 78cfd259..6e74ff7e 100644 --- a/conf/slpkg.conf +++ b/conf/slpkg.conf @@ -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 diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 1ada9233..21166d5e 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -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) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index b91c1819..1f2110af 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -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)