From 69dce9e9a60a25d70b2ea9e0f33174e3ec19b935 Mon Sep 17 00:00:00 2001 From: Steve Barnes Date: Fri, 22 Sep 2017 06:04:39 +0100 Subject: [PATCH] Split the URL into the link and filename parts for the error message. --- wx/tools/wxget.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wx/tools/wxget.py b/wx/tools/wxget.py index 03783068..9413b4ed 100644 --- a/wx/tools/wxget.py +++ b/wx/tools/wxget.py @@ -190,10 +190,13 @@ def download_file(url, dest=None, force=False, trusted=False): if not success: success = download_pip(url, filename, force, trusted) # Try urllib if not success: + split_url = url.split('/') msg = '\n'.join([ - "\n\nERROR in Web Access! - you may be behind a firewall", - "You may be able to bybass this by using a browser to download:", - "\n\t%s\n\nand copying to:\n\n\t%s" % (url, filename), + "\n\nERROR in Web Access! - You may be behind a firewall!", + "-" * 52, + "You should be able to bybass this by using a browser to download:", + "\t%s\nfrom:\t%s\nthen copying the download file to:\n\t%s" % ( + split_url[-1], '/'.join(split_url[:-1]), filename), ]) print(msg, '\n') wx.MessageBox(msg, caption='WDOWNLOAD ERROR!',