summaryrefslogtreecommitdiff
path: root/misc/openlayers/tools/closure_ws.py
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2015-10-17 21:36:38 +0200
committerChris Schlaeger <chris@linux.com>2015-10-17 21:36:38 +0200
commite30f267181d990947e67909de4809fa941698c85 (patch)
tree46e9f94c2b3699ed378963b420b8a8d361286ea1 /misc/openlayers/tools/closure_ws.py
parente763ceb183f389fcd314a4a6a712d87c9d4cdb32 (diff)
downloadpostrunner-e30f267181d990947e67909de4809fa941698c85.zip
Upgrading openlayers to 3.x
Diffstat (limited to 'misc/openlayers/tools/closure_ws.py')
-rw-r--r--misc/openlayers/tools/closure_ws.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/misc/openlayers/tools/closure_ws.py b/misc/openlayers/tools/closure_ws.py
deleted file mode 100644
index 3bf925a..0000000
--- a/misc/openlayers/tools/closure_ws.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-import httplib, urllib, sys
-import time
-# Define the parameters for the POST request and encode them in
-# a URL-safe format.
-
-def minimize(code):
-
- params = urllib.urlencode([
- ('js_code', code),
- ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),
- ('output_format', 'text'),
- ('output_info', 'compiled_code'),
- ])
-
- t = time.time()
- # Always use the following value for the Content-type header.
- headers = { "Content-type": "application/x-www-form-urlencoded" }
- conn = httplib.HTTPConnection('closure-compiler.appspot.com')
- conn.request('POST', '/compile', params, headers)
- response = conn.getresponse()
- data = response.read()
- conn.close()
- if data.startswith("Error"):
- raise Exception(data)
- print "%.3f seconds to compile" % (time.time() - t)
- return data