Skip to content

Commit 493fa91

Browse files
committed
Merge pull request #376 from google/revert-371-proxy
Revert "proxy option for build.py"
2 parents 78648b9 + f9d5bdc commit 493fa91

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

build.py

+5-20
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@
4343

4444
import errno, glob, httplib, json, os, re, subprocess, threading, urllib
4545

46-
import getopt
47-
import requests
48-
opts , args = getopt.getopt(sys.argv[1:], "hp:")
49-
proxy_url = False
50-
for op, value in opts:
51-
if op == '-h':
52-
print('-p <proxy_url> Compile via <proxy_url>, example: python build.py -p 127.0.0.1:8787')
53-
sys.exit()
54-
elif op == '-p':
55-
proxy_url = value
5646

5747
def import_path(fullpath):
5848
"""Import a file with full path specification.
@@ -273,16 +263,11 @@ def gen_generator(self, language):
273263
def do_compile(self, params, target_filename, filenames, remove):
274264
# Send the request to Google.
275265
headers = {"Content-type": "application/x-www-form-urlencoded"}
276-
277-
json_str=''
278-
if proxy_url:
279-
json_str=requests.post("http://closure-compiler.appspot.com/compile",data=params,headers=headers,proxies={"http":proxy_url,"https":proxy_url},timeout=100).content
280-
else:
281-
conn = httplib.HTTPConnection("closure-compiler.appspot.com")
282-
conn.request("POST", "/compile", urllib.urlencode(params), headers)
283-
response = conn.getresponse()
284-
json_str = response.read()
285-
conn.close()
266+
conn = httplib.HTTPConnection("closure-compiler.appspot.com")
267+
conn.request("POST", "/compile", urllib.urlencode(params), headers)
268+
response = conn.getresponse()
269+
json_str = response.read()
270+
conn.close()
286271

287272
# Parse the JSON response.
288273
json_data = json.loads(json_str)

0 commit comments

Comments
 (0)