summaryrefslogtreecommitdiffstats
path: root/yum-fast-downloader.py
diff options
context:
space:
mode:
authorHedayat Vatankhah <hedayat.fwd@gmail.com>2011-10-08 13:14:43 +0330
committerHedayat Vatankhah <hedayat.fwd@gmail.com>2011-10-08 13:14:43 +0330
commit859a834fde255f5dd98ff21119f53b421419d3c0 (patch)
tree6ff084b328fd45345a896f06d6c167d1be01303b /yum-fast-downloader.py
parentab73e7040fef9ce80b4e196ea66a5a5a8cc10b17 (diff)
downloadyum-fast-downloader-859a834fde255f5dd98ff21119f53b421419d3c0.tar.gz
yum-fast-downloader-859a834fde255f5dd98ff21119f53b421419d3c0.tar.xz
yum-fast-downloader-859a834fde255f5dd98ff21119f53b421419d3c0.zip
Fixed the arguments of the downloader application, and better output
Diffstat (limited to 'yum-fast-downloader.py')
-rw-r--r--yum-fast-downloader.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yum-fast-downloader.py b/yum-fast-downloader.py
index b22a526..e34acac 100644
--- a/yum-fast-downloader.py
+++ b/yum-fast-downloader.py
@@ -45,7 +45,8 @@ downloader_common_args = {
# downloader functions
def _getAria2CArgs(urls, remote_path, local_path, proxies = None):
- args = downloader_common_args['aria2c']
+ args = []
+ args += downloader_common_args['aria2c']
args.append("--out={0}.yfd".format(os.path.basename(local_path)))
args.append("--dir={0}".format(os.path.dirname(local_path)))
args.append("--split={0}".format(max(5, len(urls))))
@@ -61,6 +62,7 @@ def _getAria2CArgs(urls, remote_path, local_path, proxies = None):
def downloadFile(urls, remote_path, local_path, proxies = None):
if urls[0].startswith("http://") or urls[0].startswith("ftp://"):
+ print "\n==== Downloading {0} ====".format(remote_path)
args = _getAria2CArgs(urls, remote_path, local_path)
ret = os.spawnvp(os.P_WAIT, downloader_app, args)
if ret:
@@ -89,7 +91,8 @@ def queueDownload(inputFile, urls, remote_path, local_path, proxies = None):
inputFile.write(" {0}-proxy={1}\n".format(scheme, proxy))
def downloadQueuedFiles(inputFileName):
- args = downloader_common_args['aria2c']
+ args = []
+ args += downloader_common_args['aria2c']
args.append("--input-file={0}".format(inputFileName))
ret = os.spawnvp(os.P_WAIT, "aria2c", args)
sleep(1)