

def plugin_loaded():
    'Called directly from sublime on plugin load.'
    try:
        os.makedirs(((sublime.cache_path() + os.path.sep) + 'Xkcd'))
    except OSError as e:
        if (e.errno != errno.EEXIST):
            raise IOError('Error encountered during file creation.')
    settings = sublime.load_settings('Package Control.sublime-settings')
    http_proxy = settings.get('http_proxy')
    https_proxy = settings.get('https_proxy')
    proxies = {
        
    }
    if (http_proxy or https_proxy):
        if http_proxy:
            proxies['http'] = http_proxy
        if https_proxy:
            proxies['https'] = https_proxy
    proxy_username = settings.get('proxy_username')
    proxy_password = settings.get('proxy_password')
    if (proxy_username and proxy_password):
        if http_proxy:
            proxies['http'] = ((((proxy_username + ':') + proxy_password) + '@') + http_proxy)
        if https_proxy:
            proxies['https'] = ((((proxy_username + ':') + proxy_password) + '@') + https_proxy)
    global opener
    opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies))
    urllib.request.install_opener(opener)

dataset/ETHPy150Open eivind88/xkcd/xkcd.py plugin_loaded/original