Menu

#400 appengine uploading feature

open
nobody
5
2009-11-13
2009-11-13
Anonymous
No

Appengine related operations are very well handled by pydev extension, and I love its integration to google services.
I know that JS files are totally out of pydev scope, but once pydev is already uploading a complete set of files to appspot (gae). I would like to suggest the addition of a small parameter to its uploading interface: It could include a "Optimize js before uploading?"
When checked, it could post the content of the .js files (pesent in gae pydev project) to the new Closure Compiler service, uploading it already optimized
Take a look on how easy the conversion is in python:
#!/usr/bin/python2.4
import httplib, urllib, sys
# Define the parameters for the POST request and encode them in
# a URL-safe format.
params = urllib.urlencode([
('js_code', sys.argv[1]),
('compilation_level', 'WHITESPACE_ONLY'),
('output_format', 'text'),
('output_info', 'compiled_code'),
])
# 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()
print data

The example was taken from: http://code.google.com/closure/compiler/docs/api-tutorial1.html

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.