eKorpus

Source code for ekorpus.config.routing

"""Routes configuration

The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/
"""
from pylons import config
from routes import Mapper

[docs]def make_map(): """Create, configure and return the routes Mapper""" map = Mapper(directory=config['pylons.paths']['controllers'], always_scan=config['debug']) # The ErrorController route (handles 404/500 error pages); it should # likely stay at the top, ensuring it can always be resolved map.connect('error/:action/:id', controller='error') # CUSTOM ROUTES HERE map.connect('signin','/admin/signin', controller='admin', action='signin') map.connect('signout','/admin/signout', controller='admin', action='signout') map.connect('home','', controller='admin', action='index') map.connect('lang','/admin/lang/:lg', controller='admin', action='lang', lg='et') map.connect('users','/admin/list', controller='admin', action='list') map.connect('sessions','/admin/sessions', controller='admin', action='sessions') map.connect('mydata','/admin/edit_mydata', controller='admin', action='edit_mydata') map.connect('profile','/admin/profile/:id', controller='admin', action='profile', id=None) map.connect('tests','/tests/list', controller='tests', action='list') map.connect('addsegment','/tests/addsegment/:id/:sid',controller='tests', action='addsegment', id=None, sid=None) map.connect('showtest','/tests/show/:id/:uid', controller='tests', action='show') map.connect('segment','/sounds/segment/:first/:last', controller='sounds',action='segment', last=None) map.connect('recording','/sounds/recording/:id', controller='sounds',action='recording') map.connect('textgrid','/textgrid/segment/:first/:last', controller='textgrid',action='segment', last=None) map.connect('applications','/applications/list', controller='applications',action='list') map.connect('valence','/valence', controller='valence',action='index') map.connect('reports','/reports/list', controller='reports',action='list') map.connect('report_tests','/reports/tests', controller='reports',action='tests') map.connect('report_tests_result','/reports/testsresult/:id/:xml', controller='reports',action='testsresult', id=None, xml=None) map.connect('report_segments','/reports/segments', controller='reports',action='segments') map.connect('report_segments_result','/reports/segmentsresult', controller='reports',action='segmentsresult') map.connect('report_words_result','/reports/wordsresult/:emotion/:level/:neutraltext/:pos', controller='reports',action='wordsresult', emotion=None, level=None, neutraltext=None, pos='%') map.connect('report_valence','/reports/valence', controller='reports',action='valence') map.connect('report_valence_result','/reports/valenceresult', controller='reports',action='valenceresult') map.connect('scores','/reports/scores', controller='reports',action='scores') map.connect('recordings','/recordings/list', controller='recordings', action='list') map.connect('recordings_tree','/recordings/index/:rid/:sid',controller='recordings', action='index', rid=0, sid=0) map.connect('export','/export/export/:id', controller='export',action='export') map.connect(':controller/:action/:id') map.connect('*url', controller='template', action='view') return map