(path)
| 170 | # render js |
| 171 | @route("/media/js/<path:re:.+\.js>") |
| 172 | def js_dynamic(path): |
| 173 | response.headers['Expires'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", |
| 174 | time.gmtime(time.time() + 60 * 60 * 24 * 2)) |
| 175 | response.headers['Cache-control'] = "public" |
| 176 | response.headers['Content-Type'] = "text/javascript; charset=UTF-8" |
| 177 | |
| 178 | try: |
| 179 | # static files are not rendered |
| 180 | if "static" not in path and "mootools" not in path: |
| 181 | t = env.get_template("js/%s" % path) |
| 182 | return t.render() |
| 183 | else: |
| 184 | return static_file(path, root=join(PROJECT_DIR, "media", "js")) |
| 185 | except: |
| 186 | return HTTPError(404, "Not Found") |
| 187 | |
| 188 | @route('/media/<path:path>') |
| 189 | def server_static(path): |
nothing calls this directly
no test coverage detected