Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (21 sloc) 0.845 kB
2c8823c @kamens Initial import
kamens authored
1 import logging
2 import simplejson
3 import os
4
5 from google.appengine.ext.webapp import template
6 from google.appengine.ext import webapp
7
8 from gae_mini_profiler import profiler
9
10 register = webapp.template.create_template_register()
11
12 @register.simple_tag
13 def profiler_includes_request_id(request_id, show_immediately = False):
14 if not request_id:
15 return ""
16
17 path = os.path.join(os.path.dirname(__file__), "templates/includes.html")
18 return template.render(path, {
19 "request_id_js": simplejson.dumps(request_id),
20 "js_path": "/gae_mini_profiler/static/js/profiler.js",
21 "css_path": "/gae_mini_profiler/static/css/profiler.css",
22 "show_immediately_js": simplejson.dumps(show_immediately),
23 })
24
25 @register.simple_tag
26 def profiler_includes():
27 return profiler_includes_request_id(profiler.request_id)
28
29
Something went wrong with that request. Please try again.