1 #!/usr/bin/python2.5 2 # 3 # Copyright (C) 2008 The Android Open Source Project 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 """Serve static pages for the pdk on appengine 19 """ 20 21 import os 22 23 from google.appengine.ext import webapp 24 from google.appengine.ext.webapp.util import run_wsgi_app 25 26 27 class MainPage(webapp.RequestHandler): 28 def get(self): 29 self.redirect('online-pdk/guide/index.html') 30 31 application = webapp.WSGIApplication([('/', MainPage)], debug=True) 32 33 def main(): 34 run_wsgi_app(application) 35 36 if __name__ == "__main__": 37 main() 38 39 # Testing 40 # You must install google appengine. See: http://code.google.com/appengine/downloads.html 41 # 42 # Here's the command to run the pdk-docs server locally: 43 # python <path_to_appengine_installation>/dev_appserver.py --address 0.0.0.0 \ 44 # <path_to_cupcake_code>/android/out/target/common/docs 45 46 # To verify it is working you can access it with a browser loacally on port 8080: 47 48 # http://localhost:8080/index.html 49 50 51 # To upload this application: 52 # /home/build/static/projects/apphosting/devtools/appcfg.py update pdk/ 53 # where the pdk directory contains: pdk.py, app.yaml, and the docs directory. 54 # where the docs are made from the Pdk.mk file. 55