OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
2 | 5 |
3 # A python script that combines the javascript files needed by jstemplate into | 6 # A python script that combines the javascript files needed by jstemplate into |
4 # a single file. | 7 # a single file. |
5 | 8 |
6 import httplib | 9 import httplib |
7 import urllib | 10 import urllib |
8 | 11 |
9 srcs ="util.js jsevalcontext.js jstemplate.js exports.js".split() | 12 srcs ="util.js jsevalcontext.js jstemplate.js exports.js".split() |
10 out = "jstemplate_compiled.js" | 13 out = "jstemplate_compiled.js" |
11 | 14 |
(...skipping 14 matching lines...) Expand all Loading... |
26 | 29 |
27 # Always use the following value for the Content-type header. | 30 # Always use the following value for the Content-type header. |
28 headers = {'Content-type': 'application/x-www-form-urlencoded'} | 31 headers = {'Content-type': 'application/x-www-form-urlencoded'} |
29 conn = httplib.HTTPConnection('closure-compiler.appspot.com') | 32 conn = httplib.HTTPConnection('closure-compiler.appspot.com') |
30 conn.request('POST', '/compile', params, headers) | 33 conn.request('POST', '/compile', params, headers) |
31 response = conn.getresponse() | 34 response = conn.getresponse() |
32 out_file = file(out, 'w') | 35 out_file = file(out, 'w') |
33 out_file.write(output_wrapper % response.read()) | 36 out_file.write(output_wrapper % response.read()) |
34 out_file.close() | 37 out_file.close() |
35 conn.close() | 38 conn.close() |
OLD | NEW |