From 22f21b369e8f826bda7fb63288d3bf99a6f11200 Mon Sep 17 00:00:00 2001 From: Steve Barnes Date: Fri, 22 Sep 2017 12:06:38 +0100 Subject: [PATCH] Make trusted flag available as an option for wxget.py and fix some minor issues. --- wx/tools/wxget.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wx/tools/wxget.py b/wx/tools/wxget.py index 9cc7f9f9..6cc57f52 100644 --- a/wx/tools/wxget.py +++ b/wx/tools/wxget.py @@ -24,6 +24,7 @@ Usage: Where URL is a file URL and the optional DEST_DIR is a destination directory to download to, (default is to prompt the user). +The --trusted option can be used to surpress certificate checks. """ from __future__ import (division, absolute_import, print_function, unicode_literals) @@ -213,11 +214,17 @@ def main(args=sys.argv): dest_dir = '.' force_flag = '--force' trusted_flag = '--trusted' + force = False + trusted = False if force_flag in args: force = True args.remove(force_flag) + if trusted_flag in args: + trusted = True + args.remove(force_flag) + if len(args) > 2: dest_dir = args[2] else: @@ -234,7 +241,7 @@ def main(args=sys.argv): else: url = None if url: - FILENAME = download_file(url, dest_dir, force) + FILENAME = download_file(url, dest_dir, force, trusted) print(FILENAME) if __name__ == "__main__": # Only run if this file is called directly