Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
import an application (with no middleware parameters) defined using relative URL

        def callUrl(url, env, start_response, relative_url=None):
    "import an application (with no middleware parameters) defined using relative URL"
    #pr "calling url", url
    import urlcomponent
    env = env.copy()
    if relative_url is None:
        relative_url = env[whiffenv.RESPONDING_PATH]
    root = env[whiffenv.ROOT]
    absurl = urlcomponent.resolveUrl(url, relative_url)
    env["PATH_INFO"] = ""
    #pr "CALLURL RESETTING SCRIPT NAME", (env.get("SCRIPT_NAME"), absurl)
    env["SCRIPT_NAME"] = absurl
    try:
        application = root.resolve_env(env)
    except ModuleRootResolutionException:
        raise ValueError, "cannot call url %s -- module not found wrt %s" % (
            repr(url), repr(relative_url))
    return application(env, start_response)
        


src/w/h/whiff-1.1/whiff/middleware/IfJavascriptUrl.py   whiff(Download)
        javaScriptEnabled = whiffenv.cgiGet(env, "javaScriptEnabled", False)
        if javaScriptEnabled:
            return resolver.callUrl(url, env, start_response, relative_url)
        else:
            elsePage = self.param_value(self.elsePage, env)