From e1ad05783ed27b8d3b8c43abb13843885f37f36c Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 10 Jan 2017 15:29:26 +0100 Subject: [PATCH] Allow specification of a exact url for remote files. --- kiwix-build.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kiwix-build.py b/kiwix-build.py index 853f265..961042c 100755 --- a/kiwix-build.py +++ b/kiwix-build.py @@ -33,7 +33,9 @@ class SkipCommand(Exception): class StopBuild(Exception): pass -Remotefile = namedtuple('Remotefile', ('name', 'sha256')) +class Remotefile(namedtuple('Remotefile', ('name', 'sha256', 'url'))): + def __new__(cls, name, sha256, url=None): + return super().__new__(cls, name, sha256, url) class Context: def __init__(self, command_name, log_file): @@ -184,7 +186,7 @@ class BuildEnv: def download(self, what, where=None): where = where or self.archive_dir file_path = pj(where, what.name) - file_url = REMOTE_PREFIX + what.name + file_url = what.url or (REMOTE_PREFIX + what.name) if os.path.exists(file_path): if what.sha256 == get_sha256(file_path): raise SkipCommand()