• rgaudin's avatar
    Use a proxies configuration for downloads · b496b52f
    rgaudin authored
    - introduced a preferences JSON file (stored in homedir) via get_prefs() and save_prefs()
    - preferences can contain HTTP_PROXY and HTTPS_PROXY values
    - introduced a proxies variable via get_proxies()
    - proxies conf has "http" and "https" keys.
    those replicates the preference ones and contains full proxy URI: http://username:pass@server:port
    - preferences and proxies are read on startup
    - when present, proxies are superseeded by environment variables (HTTP_PROXY and HTTPS_PROXY)
    - proxy URI in prefs file or env can be socks:// (useful for tests using SSH)
    - test_connection() tests one HTTP and one HTTPS URLs
download.py 9.6 KB