Ejemplo n.º 1
0
def app(environ, start_response):

    layer, coord, ext = TileStache._splitPathInfo(environ['PATH_INFO'])

    if not config.layers.get(layer, False):
        status = '404 NOT FOUND'
        data = ''

    else:

        try:
            content_type, data = TileStache.handleRequest(config.layers[layer], coord, ext)
            status = '200 OK'

        except Exception, e:
            status = '500 SERVER ERROR'
            data = str(e)