Created
January 28, 2014 14:20
-
-
Save nomadmonad/8668538 to your computer and use it in GitHub Desktop.
認証付きプロキシの環境でPackage Controlを導入する方法 ref: http://qiita.com/nomadmonad/items/ed172b595bb300727340
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler({"http": "http://[username]:[password]@[proxy_server]:[port]", "https": "https://[username]:[password]@[proxy_address]:[port]"})) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"http_proxy": "http://[proxy_server]:[port]", | |
"https_proxy": "https://[proxy_server]:[port]", | |
"proxy_username": "username", | |
"proxy_password": "password" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment