Example #1
0
def get_matching_app(settings):
    static_app = DirectoryApp(settings['weiwei.static'])
    static_matching = m('/static/*path', static_app, name='static')
    matching = bundle(
        static_matching,
        include('', web_matching),
    )
    return make_wsgi_app(matching)
Example #2
0
from matcha import Matching as m
from matcha import include, bundle


about_pages = bundle(
    m('/htt/', 'htt', 'about_htt'),
    m('/activity/*activity', 'activity', 'about_activity')
)

member_pages = bundle(
    m('/', 'member_list', 'member_list'),
    m('/{member}/', 'member_detail', 'member_detail'),
)

matching = bundle(
    m('/', 'home', 'home'),
    include('/about/', about_pages),
    include('/member/', member_pages),
)


def test_it():
    assert matching['/'] == ('home', {})
    assert matching['/about/htt/'] == ('htt', {})
    assert matching['/about/activity/outdoor_fes/2013/winter'] == \
        ('activity', {'activity': ['outdoor_fes', '2013', 'winter']})
    assert matching['/member/'] == ('member_list', {})
    assert matching['/member/ritsu/'] == ('member_detail', {'member': 'ritsu'})
Example #3
0
from matcha import Matching as m

from .views import TopController

matching = m('/', TopController(), name='top')
Example #4
0
from matcha import Matching as m, bundle

from weiwei.web import login_dispatch, page_dispatch


matching = bundle(m("/login", login_dispatch, name="web_login"), m("/{page_title}", page_dispatch, name="web_page"))
Example #5
0
from matcha import Matching as m

from guestbook.views import TopController

matching = m('/', TopController(), name='guestbook:top')