Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Get the absolute url path to a component given a path
relative to the calling WHIFF component.  For example if caller is at
/xxx/yyy/zzz and relative path is "../www.js" then result should
be /xxx/www.js

        def absPath(env, relativePath):
    """
    Get the absolute url path to a component given a path
    relative to the calling WHIFF component.  For example if caller is at
    /xxx/yyy/zzz and relative path is "../www.js" then result should
    be /xxx/www.js
    """
    root = env[ROOT]
    # script name gives path to caller (possibly reset).
    script_name = env["SCRIPT_NAME"]
    # if no script name use entry point
    if not script_name:
        script_name = env[ENTRY_POINT]
    script_path = script_name.split("/")
    #script_path = env.get(whiffenv.TEMPLATE_PATH)
    #pr "resolving (relativePath, script_path)", (relativePath, script_path)
    result = root.absolute_path(relativePath, script_path)
    if relativePath.endswith("/") and not result.endswith("/"):
        result += "/"
    #pr "result is", result
    return result
        


src/w/h/whiff-1.1/whiff/middleware/ofc/OpenFlashChart.py   whiff(Download)
        substitutions = {}
        # add the swfobject library and other javascript if not added yet
        swfobject_js = whiffenv.absPath(env, "whiff_middleware/ofc/swfobject.js") # this may get a bit redundant
        additional = ADDITIONAL_JAVASCRIPT_TEMPLATE % {
            "swfobject_js": swfobject_js}
        addApp = insertIfNeeded.__middleware__(text=additional,
                                               doneFlag="OpenFlashChart.swfobject")
        additional_javascript = self.param_value(addApp, env)
        # find the flash library location
        open_flash_chart_swf = whiffenv.absPath(env, "whiff_middleware/ofc/open-flash-chart.swf")