コード例 #1
0
ファイル: handler.py プロジェクト: FND/tiddlyspace.old
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)
コード例 #2
0
ファイル: handler.py プロジェクト: colmjude/tiddlyspace
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)
コード例 #3
0
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)
コード例 #4
0
ファイル: handler.py プロジェクト: EnoX1/tiddlyspace
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)
コード例 #5
0
ファイル: handler.py プロジェクト: EnoX1/tiddlyspace
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)
コード例 #6
0
ファイル: handler.py プロジェクト: colmjude/tiddlyspace
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)
コード例 #7
0
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)
コード例 #8
0
ファイル: __init__.py プロジェクト: cdent/tiddlyrecon
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)