Xavier Ducrohet | b958224 | 2009-12-01 13:03:49 -0800 | [diff] [blame] | 1 | #!/usr/bin/python2.4 |
| 2 | # |
| 3 | # Copyright (C) 2008 Google Inc. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | |
| 18 | """Constants for the divide_and_compress script and DirectoryZipper class.""" |
| 19 | |
| 20 | __author__ = 'jmatt@google.com (Justin Mattson)' |
| 21 | |
| 22 | file_preamble = """#!/usr/bin/env python |
| 23 | # |
| 24 | # Copyright 2008 Google Inc. |
| 25 | # |
| 26 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 27 | # you may not use this file except in compliance with the License. |
| 28 | # You may obtain a copy of the License at |
| 29 | # |
| 30 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 31 | # |
| 32 | # Unless required by applicable law or agreed to in writing, software |
| 33 | # distributed under the License is distributed on an \"AS IS\" BASIS, |
| 34 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 35 | # See the License for the specific language governing permissions and |
| 36 | # limitations under the License. |
| 37 | # |
| 38 | |
Trevor Johns | e52271a | 2012-01-27 20:02:18 -0800 | [diff] [blame] | 39 | import wsgiref.handlers |
| 40 | from google.appengine.ext import zipserve |
| 41 | from google.appengine.ext import webapp |
| 42 | import memcache_zipserve |
| 43 | |
Xavier Ducrohet | b958224 | 2009-12-01 13:03:49 -0800 | [diff] [blame] | 44 | class MainHandler(webapp.RequestHandler): |
| 45 | |
| 46 | def get(self): |
| 47 | self.response.out.write('Hello world!') |
| 48 | |
| 49 | def main(): |
Trevor Johns | e52271a | 2012-01-27 20:02:18 -0800 | [diff] [blame] | 50 | handler = memcache_zipserve.create_handler([""" |
Xavier Ducrohet | b958224 | 2009-12-01 13:03:49 -0800 | [diff] [blame] | 51 | |
Trevor Johns | e52271a | 2012-01-27 20:02:18 -0800 | [diff] [blame] | 52 | file_endpiece = """ |
| 53 | ]) |
| 54 | application = webapp.WSGIApplication([('/(.*)', handler)], debug=False) |
Xavier Ducrohet | b958224 | 2009-12-01 13:03:49 -0800 | [diff] [blame] | 55 | wsgiref.handlers.CGIHandler().run(application) |
| 56 | |
Trevor Johns | e52271a | 2012-01-27 20:02:18 -0800 | [diff] [blame] | 57 | if __name__ == '__main__': |
| 58 | main() |
| 59 | """ |