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
This commit is contained in:
@@ -36,23 +36,24 @@ file_preamble = """#!/usr/bin/env python
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import wsgiref.handlers\n'
|
import wsgiref.handlers
|
||||||
from google.appengine.ext import zipserve\n'
|
from google.appengine.ext import zipserve
|
||||||
from google.appengine.ext import webapp\n'
|
from google.appengine.ext import webapp
|
||||||
import memcache_zipserve\n\n\n'
|
import memcache_zipserve
|
||||||
|
|
||||||
class MainHandler(webapp.RequestHandler):
|
class MainHandler(webapp.RequestHandler):
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
self.response.out.write('Hello world!')
|
self.response.out.write('Hello world!')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
application = webapp.WSGIApplication(['/(.*)',
|
handler = memcache_zipserve.create_handler(["""
|
||||||
memcache_zipserve.create_handler(["""
|
|
||||||
|
|
||||||
file_endpiece = """])),
|
file_endpiece = """
|
||||||
],
|
])
|
||||||
debug=False)
|
application = webapp.WSGIApplication([('/(.*)', handler)], debug=False)
|
||||||
wsgiref.handlers.CGIHandler().run(application)
|
wsgiref.handlers.CGIHandler().run(application)
|
||||||
|
|
||||||
if __name__ == __main__:
|
if __name__ == '__main__':
|
||||||
main()"""
|
main()
|
||||||
|
"""
|
||||||
Reference in New Issue
Block a user