2009-01-21 16:11:39 +01:00
|
|
|
# -*- python -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2014-02-08 23:54:51 +01:00
|
|
|
# Debian Member Portfolio Service routing configuration
|
2009-01-21 16:11:39 +01:00
|
|
|
#
|
2014-02-08 23:54:51 +01:00
|
|
|
# Copyright © 2009-2014 Jan Dittberner <jan@dittberner.info>
|
2009-01-21 16:11:39 +01:00
|
|
|
#
|
2014-02-08 23:54:51 +01:00
|
|
|
# This file is part of the Debian Member Portfolio Service.
|
2009-01-21 16:11:39 +01:00
|
|
|
#
|
2014-02-08 23:54:51 +01:00
|
|
|
# Debian Member Portfolio Service is free software: you can redistribute it
|
|
|
|
# and/or modify it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the License,
|
|
|
|
# or (at your option) any later version.
|
2009-01-21 16:11:39 +01:00
|
|
|
#
|
2014-02-08 23:54:51 +01:00
|
|
|
# Debian Member Portfolio Service is distributed in the hope that it will be
|
|
|
|
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
|
|
|
|
# General Public License for more details.
|
2009-01-21 16:11:39 +01:00
|
|
|
#
|
2014-02-08 23:54:51 +01:00
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
2014-10-14 13:38:29 +02:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2014-02-08 23:54:51 +01:00
|
|
|
#
|
|
|
|
"""
|
|
|
|
Routes configuration
|
2009-01-20 22:39:05 +01:00
|
|
|
|
|
|
|
The more specific and detailed routes should be defined first so they
|
|
|
|
may take precedent over the more generic routes. For more information
|
2014-10-14 13:38:29 +02:00
|
|
|
refer to the routes manual at https://routes.readthedocs.org/
|
2014-02-08 23:54:51 +01:00
|
|
|
|
2009-01-20 22:39:05 +01:00
|
|
|
"""
|
2014-02-08 23:54:51 +01:00
|
|
|
|
2009-01-20 22:39:05 +01:00
|
|
|
from routes import Mapper
|
|
|
|
|
2012-01-07 01:46:57 +01:00
|
|
|
|
2010-04-16 21:44:13 +02:00
|
|
|
def make_map(config):
|
2014-02-08 23:54:51 +01:00
|
|
|
"""
|
|
|
|
Create, configure and return the routes Mapper
|
|
|
|
|
|
|
|
"""
|
2009-01-20 22:39:05 +01:00
|
|
|
map = Mapper(directory=config['pylons.paths']['controllers'],
|
2010-04-16 21:44:13 +02:00
|
|
|
always_scan=config['debug'], explicit=True)
|
|
|
|
map.minimization = False
|
2009-01-20 22:39:05 +01:00
|
|
|
|
|
|
|
# The ErrorController route (handles 404/500 error pages); it should
|
|
|
|
# likely stay at the top, ensuring it can always be resolved
|
2010-04-16 21:44:13 +02:00
|
|
|
map.connect('/error/{action}', controller='error')
|
|
|
|
map.connect('/error/{action}/{id}', controller='error')
|
2009-01-20 22:39:05 +01:00
|
|
|
|
|
|
|
# CUSTOM ROUTES HERE
|
2014-02-08 23:54:51 +01:00
|
|
|
map.connect('/', controller='portfolio', action='index')
|
|
|
|
map.connect('/result', controller='portfolio', action='urllist')
|
2010-04-16 21:44:13 +02:00
|
|
|
map.connect('/htmlformhelper.js', controller='showformscripts',
|
2009-01-23 18:03:39 +01:00
|
|
|
action='index')
|
2010-04-16 21:44:13 +02:00
|
|
|
|
|
|
|
map.connect('/{controller}/{action}')
|
|
|
|
map.connect('/{controller}/{action}/{id}')
|
2009-01-20 22:39:05 +01:00
|
|
|
|
|
|
|
return map
|