#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Main handlers. 
# Copyright (c) 2009 happychickoo.
#
# The MIT License
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

import configuration
from google.appengine.ext import db, webapp
from google.appengine.api import memcache
from google.appengine.ext.webapp.util import run_wsgi_app

import logging

logging.basicConfig(level=logging.DEBUG)


class IndexHandler(webapp.RequestHandler):
    """Handles the home page requests."""
    def get(self):
        response = render_template('index.html')
        self.response.out.write(response)

# URL to request handler mappings.
urls = (
    ('/', IndexHandler),
)

# Web application entry-point.
def main():
    application = webapp.WSGIApplication(urls, debug=configuration.DEBUG)
    from gaefy.db.datastore_cache import DatastoreCachingShim
    DatastoreCachingShim.Install()
    run_wsgi_app(application)
    DatastoreCachingShim.Uninstall()

if __name__ == '__main__':
    main()

@@ -1194,16 +1194,74 @@
 uration%0A
+from gaefy.db.datastore_cache import DatastoreCachingShim%0A
 from goo
@@ -1400,24 +1400,79 @@
 app%0A
-%0Aimport logging%0A
+from utilities import render_template%0Aimport logging%0A%0A# Set up logging.
 %0Alog
@@ -1510,16 +1510,26 @@
 DEBUG)%0A%0A
+# Handlers
 %0Aclass I
@@ -1726,20 +1726,20 @@
  URL
- to 
+-to-
 request
- 
+-
 hand
@@ -1910,70 +1910,8 @@
 UG)%0A
-    from gaefy.db.datastore_cache import DatastoreCachingShim%0A
     

Include the render_template utility function as an import into the handlers module