def intro(environ, start_response): """ serves landing page generated from tiddlers in _homepage bag """ environ['wsgiorg.routing_args'][1]['bag_name'] = '_homepage' environ['wsgiorg.routing_args'][1]['tiddler_name'] = 'index.html' return get_tiddler(environ, start_response)
def friendly_uri(environ, start_response): """ Transform a not alread mapped request at the root of a space into a request for a tiddler in the public or private recipe of the current space. """ _setup_friendly_environ(environ) return get_tiddler(environ, start_response)
def friendly_uri(environ, start_response): """ Transform a not alread mapped request at the root of a space into a request for a tiddler in the public or private recipe of the current space. """ http_host, host_url = determine_host(environ) if http_host == host_url: raise HTTP404('No resource found') else: space_name = determine_space(environ, http_host) recipe_name = determine_space_recipe(environ, space_name) # tiddler_name already in uri environ['wsgiorg.routing_args'][1]['recipe_name'] = recipe_name.encode( 'UTF-8') return get_tiddler(environ, start_response)
def serve_space(environ, start_response, http_host): """ Serve a space determined from the current virtual host and user. The user determines whether the recipe uses is public or private. """ space_name = determine_space(environ, http_host) recipe_name = determine_space_recipe(environ, space_name) environ['wsgiorg.routing_args'][1]['recipe_name'] = recipe_name.encode( 'UTF-8') _, mime_type = get_serialize_type(environ) _extra_query_update(environ) index = environ['tiddlyweb.space_settings']['index'] if index: environ['wsgiorg.routing_args'][1]['tiddler_name'] = index.encode( 'UTF-8') return get_tiddler(environ, start_response) if 'text/html' in mime_type: environ['tiddlyweb.type'] = 'text/x-tiddlywiki' return get_tiddlers(environ, start_response)
def get_root(environ, start_response): # XXX: "root" inappropriate!? from tiddlyweb.web.handler.tiddler import get as get_tiddler environ["wsgiorg.routing_args"][1]["bag_name"] = APP_BAG environ["wsgiorg.routing_args"][1]["tiddler_name"] = "index.html" return get_tiddler(environ, start_response)