summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTrevor Johns <trevorjohns@google.com>2012-01-27 20:02:18 -0800
committerTrevor Johns <trevorjohns@google.com>2012-01-27 20:08:25 -0800
commite52271aff9f4efe9f0eee9ee4fa218f38776aeb4 (patch)
tree76625a6f7b0299ef9f24176d038be7cc424e8403 /scripts
parent5d1dd1c68f1cefd22a67736677ab19f3fddc0033 (diff)
downloadandroid_development-e52271aff9f4efe9f0eee9ee4fa218f38776aeb4.tar.gz
android_development-e52271aff9f4efe9f0eee9ee4fa218f38776aeb4.tar.bz2
android_development-e52271aff9f4efe9f0eee9ee4fa218f38776aeb4.zip
Generate a valid main.py for use with developer.android.com.
This fixes bugs in divide_and_compress_constants.py that caused a corrupt main.py file to be generated for developer.android.com. Specifically, extra quotes are no longer added, __main__ is now in quotes, and webapp.WSGIApplication() parameters are now correct. Also moved the call to memcache_zipserve.create_handler() to a seperate line for readability. Change-Id: I8906c54e70b2889389a95b92d4fbcf05a6c3e22d
Diffstat (limited to 'scripts')
-rw-r--r--scripts/divide_and_compress_constants.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/scripts/divide_and_compress_constants.py b/scripts/divide_and_compress_constants.py
index 15162b712..89a607d2b 100644
--- a/scripts/divide_and_compress_constants.py
+++ b/scripts/divide_and_compress_constants.py
@@ -36,23 +36,24 @@ file_preamble = """#!/usr/bin/env python
# limitations under the License.
#
-import wsgiref.handlers\n'
-from google.appengine.ext import zipserve\n'
-from google.appengine.ext import webapp\n'
-import memcache_zipserve\n\n\n'
+import wsgiref.handlers
+from google.appengine.ext import zipserve
+from google.appengine.ext import webapp
+import memcache_zipserve
+
class MainHandler(webapp.RequestHandler):
def get(self):
self.response.out.write('Hello world!')
def main():
- application = webapp.WSGIApplication(['/(.*)',
- memcache_zipserve.create_handler(["""
+ handler = memcache_zipserve.create_handler(["""
-file_endpiece = """])),
-],
-debug=False)
+file_endpiece = """
+ ])
+ application = webapp.WSGIApplication([('/(.*)', handler)], debug=False)
wsgiref.handlers.CGIHandler().run(application)
-if __name__ == __main__:
- main()"""
+if __name__ == '__main__':
+ main()
+""" \ No newline at end of file