def enable(): """ install the auth service. """ from skunk.web.context import InitContextHook if not _auth_hook in InitContextHook: InitContextHook.append(_auth_hook)
elif isinstance(r, (list, tuple)): if (len(r)==2 and isinstance(r[0], (list, tuple)) and isinstance(r[1], dict)): map.connect(*r[0], **r[1]) else: map.connect(*r) else: raise ValueError, "wrong arguments for connect()" map.create_regs(list(Configuration.controllers)) context.routes_mapper=map request_config().redirect=_redirect # initial the mapper in the context middleware InitContextHook.append(initMapper) class RoutingMiddleware(routes.middleware.RoutesMiddleware): """ trivial subclass of routes' own middleware """ def __init__(self, app, use_method_override=False, path_info=True): super(RoutingMiddleware, self).__init__(app, None, use_method_override, path_info) def mapper(): def fget(self): return Context.routes_mapper
def enable(): if not _init_session_hook in InitContextHook: InitContextHook.append(_init_session_hook) if not _session_cleanup_hook in CleanupContextHook: CleanupContextHook.append(_session_cleanup_hook)