How do I get the absolute path for static assets ? The reason I need the absolute path is to determine the last modified time of a specific file so I can append it to my static resources like JS and CSS files. I wrote a Mako template def like this but it fails at : here = os.path.dirname(__file__)

<%def name="appendFileModifiedTime(path)">
<%
    fmTime = -1
    import os
    here = os.path.dirname(__file__)
    path = os.path.join(here,path)
    if os.path.exists(path):
        fmTime = os.stat(path)[8]
    else:
        fmTime = -999

    path = path +'?%s'%fmTime

    return path
%>
</%def>

Thanks,
Jay

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to