Mercurial > templog
comparison web/templog.py @ 189:101c66da848d
watcher script
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 09 Feb 2014 11:41:13 +0800 |
parents | ae5efca89001 |
children | 8318d50d766d |
comparison
equal
deleted
inserted
replaced
188:ae5efca89001 | 189:101c66da848d |
---|---|
56 | 56 |
57 return str(post_json['params']) | 57 return str(post_json['params']) |
58 | 58 |
59 @route('/set') | 59 @route('/set') |
60 def set(): | 60 def set(): |
61 allowed = ["false", "true"][secure.get_user_hash() in config.ALLOWED_USERS] | |
61 return bottle.template('set', | 62 return bottle.template('set', |
62 inline_data = log.get_params(), | 63 inline_data = log.get_params(), |
63 csrf_blob = secure.get_csrf_blob()) | 64 csrf_blob = secure.get_csrf_blob(), |
65 allowed = allowed) | |
64 | 66 |
65 @route('/set_current.json') | 67 @route('/set_current.json') |
66 def set_fresh(): | 68 def set_fresh(): |
67 response.set_header('Content-Type', 'application/javascript') | 69 response.set_header('Content-Type', 'application/javascript') |
68 return log.get_current() | 70 return log.get_current() |
111 return log.tail_debug_log() | 113 return log.tail_debug_log() |
112 | 114 |
113 @route('/env') | 115 @route('/env') |
114 def env(): | 116 def env(): |
115 response.set_header('Content-Type', 'text/plain') | 117 response.set_header('Content-Type', 'text/plain') |
116 return '\n'.join(traceback.format_stack()) | 118 #return '\n'.join(traceback.format_stack()) |
117 #return '\n'.join(("%s %s" % k) for k in request.environ.items()) | 119 return '\n'.join(("%s %s" % k) for k in request.environ.items()) |
118 #return str(request.environ) | 120 #return str(request.environ) |
119 #yield "\n" | 121 #yield "\n" |
120 #var_lookup = environ['mod_ssl.var_lookup'] | 122 #var_lookup = environ['mod_ssl.var_lookup'] |
121 #return var_lookup("SSL_SERVER_I_DN_O") | 123 #return var_lookup("SSL_SERVER_I_DN_O") |
122 | 124 |