Example #1
0
 def wrapper_factory(global_conf, **local_conf):
     mapper = routes.Mapper()
     sub_routers = []
     # NOTE(dstanek): Routers should be ordered by their frequency of use in
     # a live system. This is due to the routes implementation. The most
     # frequently used routers should appear first.
     if project_routers:
         all_api_routers = set(project_routers)
         for api_routers in all_api_routers:
             api_routers.Routers().append_routers(mapper, sub_routers)
     for r in mapper.matchlist:
         LOG.debug('name:[%s], path:[%s], method:[%s]' %
                   (r.name, r.regpath, r.conditions.get('method')))
     return router.ComposingRouter(mapper, sub_routers)
Example #2
0
import routes
from simpleservice.wsgi import router

from goperation.manager.wsgi.agent.routers import Routers as agent_routes

mapper = routes.Mapper()

agent_route = agent_routes()
agent_route.append_routers(mapper)

testing_route = router.ComposingRouter(mapper)

for x in mapper.matchlist:
    print x.name

route_dict = mapper._routenames

for route_name in route_dict:
    print route_name, route_dict[route_name].conditions.get('method'),
    print route_dict[route_name].defaults.get(
        'action'), route_dict[route_name].routepath