From f9d5bdcaf351c4ce0fc5bcf54fba9ebd02301dad Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sat, 21 May 2016 02:50:31 -0700 Subject: [PATCH] Revert "proxy option for build.py" --- build.py | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/build.py b/build.py index 800812fb3..52701d8d9 100755 --- a/build.py +++ b/build.py @@ -43,16 +43,6 @@ if sys.version_info[0] != 2: import errno, glob, httplib, json, os, re, subprocess, threading, urllib -import getopt -import requests -opts , args = getopt.getopt(sys.argv[1:], "hp:") -proxy_url = False -for op, value in opts: - if op == '-h': - print('-p Compile via , example: python build.py -p 127.0.0.1:8787') - sys.exit() - elif op == '-p': - proxy_url = value def import_path(fullpath): """Import a file with full path specification. @@ -273,16 +263,11 @@ class Gen_compressed(threading.Thread): def do_compile(self, params, target_filename, filenames, remove): # Send the request to Google. headers = {"Content-type": "application/x-www-form-urlencoded"} - - json_str='' - if proxy_url: - json_str=requests.post("http://closure-compiler.appspot.com/compile",data=params,headers=headers,proxies={"http":proxy_url,"https":proxy_url},timeout=100).content - else: - conn = httplib.HTTPConnection("closure-compiler.appspot.com") - conn.request("POST", "/compile", urllib.urlencode(params), headers) - response = conn.getresponse() - json_str = response.read() - conn.close() + conn = httplib.HTTPConnection("closure-compiler.appspot.com") + conn.request("POST", "/compile", urllib.urlencode(params), headers) + response = conn.getresponse() + json_str = response.read() + conn.close() # Parse the JSON response. json_data = json.loads(json_str)