2009-01-21 16:11:39 +01:00
|
|
|
# -*- python -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# DDPortfolio service routing configuration
|
2010-04-16 21:44:13 +02:00
|
|
|
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
2009-01-21 16:11:39 +01:00
|
|
|
#
|
|
|
|
# This file is part of DDPortfolio service.
|
|
|
|
#
|
|
|
|
# DDPortfolio 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.
|
|
|
|
#
|
|
|
|
# DDPortfolio 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.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public
|
|
|
|
# License along with this program. If not, see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2009-01-20 22:39:05 +01:00
|
|
|
"""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/docs/
|
|
|
|
"""
|
|
|
|
from routes import Mapper
|
|
|
|
|
2010-04-16 21:44:13 +02:00
|
|
|
def make_map(config):
|
2009-01-20 22:39:05 +01:00
|
|
|
"""Create, configure and return the routes Mapper"""
|
|
|
|
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
|
2010-04-16 21:44:13 +02:00
|
|
|
map.connect('/', controller='ddportfolio', action='index')
|
|
|
|
map.connect('/result', controller='ddportfolio', action='urllist')
|
|
|
|
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
|