Source

Pypaste / friendpaste / urls.py

The default branch has multiple heads

# -*- coding: utf-8 -
# Copyright 2008 by Benoît Chesneau <benoitc@e-engura.com>
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from werkzeug.routing import Map, Rule, RequestRedirect,Submount

from friendpaste import views

all_views = {
        'paste/create': views.create_snippet,
        'paste/view': views.view_snippet,
        'paste/raw': views.view_rawsnippet,
        'paste/original': views.view_original,
        'paste/edit': views.edit_snippet,
        'paste/fork': views.fork_snippet,
        'paste/delete': views.delete_snippet,
        'paste/lock': views.lock_snippet,
        'paste/unlock': views.lock_snippet,
        'paste/changeset': views.view_changeset,
        'paste/revisions': views.view_revisions,
        'paste/rss': views.view_rss,
        'settings': views.fpsettings,
        'paste/all_languages': views.get_all_languages,
        'generic/about': views.about,
        'generic/services': views.services,
        'paste/highlight': views.highlight,
        'paste/embed': views.embed,
        'paste/reviews': views.snippet_reviews,
        'paste/review': views.snippet_review,
        'paste/reviewset': views.snippet_reviews_set,
        'login': views.login,
        'logout': views.logout,
        'languages': views.fplanguages,
        'paste/pylint': views.view_pylint
}


urls_map = Map([ 
    Rule('/', endpoint='paste/create'),
    Rule('/highlight', endpoint='paste/highlight'),
    Rule('/about', endpoint='generic/about'),
    Rule('/services/<page>', endpoint='generic/services'),
    Rule('/services', endpoint='generic/services'),
    Rule('/settings', endpoint='settings'),
    Rule('/set_languages', endpoint='languages'),
    Rule('/_all_languages', endpoint='paste/all_languages'),
    Rule('/<id>_<rev>/raw', endpoint='paste/raw'),
    Rule('/<id>_<rev>/original', endpoint='paste/original'),
    Rule('/<id>/logout', endpoint='logout'),
    Rule('/<id>/login', endpoint='login'),
    Rule('/<id>/rss', endpoint='paste/rss'),
    Rule('/<id>/edit', endpoint='paste/edit'),
    Rule('/<id>/fork', endpoint='paste/fork'),
    Rule('/<id>/delete', endpoint='paste/delete'),
    Rule('/<id>/lock', endpoint='paste/lock'),
    Rule('/<id>/unlock', endpoint='paste/unlock'),
    Rule('/<id>/report', endpoint='paste/pylint'),
    Rule('/<id>/changeset', endpoint='paste/changeset'),
    Rule('/<id>/revisions', endpoint='paste/revisions'),
    Rule('/<id>/review/<nb_line>', endpoint='paste/review'),
    Rule('/<id>/reviews/<nb_line>', endpoint='paste/reviews'),
    Rule('/<id>/reviewset/<nb_line>', endpoint='paste/reviewset'),
    Rule('/<id>.js', endpoint='paste/embed'),
    Rule('/<id>', endpoint='paste/view') 
])


OTHER_PATHS = ['highlight', 'about', 'services', 'settings', '_all_languages',
        'set_languages', '.', '_']