From 1795b5e7c70a52f1ae58b41a58c7c592a416796e Mon Sep 17 00:00:00 2001 From: Steve Barnes Date: Sun, 6 Aug 2017 13:07:57 +0100 Subject: [PATCH] Added get_docs_demo_url to get the documents or demo URL. --- wx/tools/wxget.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wx/tools/wxget.py b/wx/tools/wxget.py index 3d0ef914..8679a832 100644 --- a/wx/tools/wxget.py +++ b/wx/tools/wxget.py @@ -33,6 +33,16 @@ else: from urllib2 import HTTPError import urlparse +def get_docs_demo_url(demo=False): + """ Get the URL for the docs or demo.""" + if demo: + pkg = 'demo' + else: + pkg = 'docs' + base_url = "https://extras.wxpython.org/wxPython4/extras/%s/wxPython-%s-%s.tar.gz" + ver = wx.version().split(' ')[0] + return base_url % (ver, pkg, ver) + def get_save_path(url, dest_dir, force=False): """ Get the file save location.""" if not dest_dir: @@ -133,7 +143,7 @@ if __name__ == "__main__": # Only run if this file is called directly wx.YES_NO|wx.CENTER) if YES_NO == wx.YES: print("Testing with wxDemo") - URL = "https://extras.wxpython.org/wxPython4/extras/4.0.0a3/wxPython-demo-4.0.0a3.tar.gz" + URL = get_docs_demo_url(True) else: URL = None if URL: