fixed searilization of request/response/session in tickets (they are stored as html, thanks Dominik
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.4.1-alpha.2+timestamp.2013.01.17.11.34.20
|
Version 2.4.1-alpha.2+timestamp.2013.01.17.17.32.33
|
||||||
|
|||||||
@@ -7,148 +7,133 @@
|
|||||||
{{if output:}}<h4>{{=output}}</h4>{{pass}}
|
{{if output:}}<h4>{{=output}}</h4>{{pass}}
|
||||||
<h3>{{=T('Version')}}</h3>
|
<h3>{{=T('Version')}}</h3>
|
||||||
<table class="versions">
|
<table class="versions">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>web2py™</th>
|
<th>web2py™</th>
|
||||||
<td>{{=myversion}}</td>
|
<td>{{=myversion}}</td>
|
||||||
|
</tr>
|
||||||
|
{{if snapshot:}}
|
||||||
|
<tr>
|
||||||
|
<th>Python</th>
|
||||||
|
<td>{{=snapshot.get('pyver','')}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{if snapshot:}}
|
{{pass}}
|
||||||
<tr>
|
</tbody>
|
||||||
<th>Python</th>
|
|
||||||
<td>{{=snapshot.get('pyver','')}}</td>
|
|
||||||
</tr>
|
|
||||||
{{pass}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
{{if traceback or code or layer:}}
|
{{if traceback or code or layer:}}
|
||||||
<h3>{{=T('Traceback')}}</h3>
|
<h3>{{=T('Traceback')}}</h3>
|
||||||
<div class="inspect resp1">{{=traceback}}</div>
|
<div class="inspect resp1">{{=traceback}}</div>
|
||||||
{{if snapshot:}}
|
{{if snapshot:}}
|
||||||
{{try:}}
|
{{try:}}
|
||||||
<!-- ERROR SNAPSHOT -->
|
<!-- ERROR SNAPSHOT -->
|
||||||
<h3>{{=T('Error snapshot')}}
|
<h3>{{=T('Error snapshot')}}
|
||||||
<a href="#" rel="tooltip" data-placement="right" data-original-title="{{=T('Detailed traceback description')}}">
|
<a href="#" rel="tooltip" data-placement="right" data-original-title="{{=T('Detailed traceback description')}}">
|
||||||
{{=helpicon()}}
|
{{=helpicon()}}
|
||||||
<span>{{=T("Detailed traceback description")}}</span>
|
<span>{{=T("Detailed traceback description")}}</span>
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
<!-- SNAPSHOT LIST -->
|
<!-- SNAPSHOT LIST -->
|
||||||
<div id="snapshot">
|
<div id="snapshot">
|
||||||
<!-- Exception details -->
|
<!-- Exception details -->
|
||||||
<p class="exception_object inspect">
|
<p class="exception_object inspect">
|
||||||
<code>{{=snapshot['etype']}}({{=snapshot['evalue']}})</code>
|
<code>{{=snapshot['etype']}}({{=snapshot['evalue']}})</code>
|
||||||
</p>
|
</p>
|
||||||
<p class="controls">
|
<p class="controls">
|
||||||
<a class="button btn" onclick="collapse('exception_inner');"><span>{{=T('inspect attributes')}}</span></a>
|
<a class="button btn" onclick="collapse('exception_inner');"><span>{{=T('inspect attributes')}}</span></a>
|
||||||
</p>
|
</p>
|
||||||
<div id="exception_inner" class="hide">
|
<div id="exception_inner" class="hide">
|
||||||
<div class="inspect">
|
<div class="inspect">
|
||||||
<h5>{{=T("Exception instance attributes")}}</h5>
|
<h4>{{=T("Exception instance attributes")}}</h4>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{for k,v in snapshot['exception'].items():}}
|
{{for k,v in snapshot['exception'].items():}}
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{=k}}</th>
|
<th>{{=k}}</th>
|
||||||
<td>{{=v}}</td>
|
<td>{{=v}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- FRAMES -->
|
<!-- FRAMES -->
|
||||||
<div id="frames">
|
<div id="frames">
|
||||||
<h4>{{=T('Frames')}}</h4>
|
<h4>{{=T('Frames')}}</h4>
|
||||||
<ul class="unstyled">
|
<ul class="unstyled">
|
||||||
{{for i, frame in enumerate(snapshot['frames']):}}
|
{{for i, frame in enumerate(snapshot['frames']):}}
|
||||||
<li>
|
<li>
|
||||||
{{is_hidden = (i != len(snapshot['frames'])-1 and 'hide' or 'inspect')}}
|
{{is_hidden = (i != len(snapshot['frames'])-1 and 'hide' or 'inspect')}}
|
||||||
<div class="framefile inspect controls">
|
<div class="framefile inspect controls">
|
||||||
<p>
|
<p>
|
||||||
<strong>File {{="%s in %s at line %s" % (frame['file'], frame['func'], frame['lnum'])}}</strong>
|
<strong>File {{="%s in %s at line %s" % (frame['file'], frame['func'], frame['lnum'])}}</strong>
|
||||||
<a class="button tbbutton btn" onclick="collapse('{{='%s_code_inner' % i}}');"><span>{{=T("code")}}</span></a>
|
<a class="button tbbutton btn" onclick="collapse('{{='%s_code_inner' % i}}');"><span>{{=T("code")}}</span></a>
|
||||||
<a class="button tbbutton btn" onclick="collapse('{{='%s_args_inner' % i}}');"><span>{{=T("arguments")}}</span></a>
|
<a class="button tbbutton btn" onclick="collapse('{{='%s_args_inner' % i}}');"><span>{{=T("arguments")}}</span></a>
|
||||||
<a class="button tbbutton btn" onclick="collapse('{{='%s_vars_inner' % i}}');"><span>{{=T("variables")}}</span></a>
|
<a class="button tbbutton btn" onclick="collapse('{{='%s_vars_inner' % i}}');"><span>{{=T("variables")}}</span></a>
|
||||||
</p>
|
</p>
|
||||||
<div id="{{='%s_args_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
|
<div id="{{='%s_args_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
|
||||||
<h5>Function argument list</h5>
|
<h5>Function argument list</h5>
|
||||||
<p>{{=frame['call']}}</p>
|
<p>{{=frame['call']}}</p>
|
||||||
</div>
|
|
||||||
<div id="{{='%s_code_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
|
|
||||||
<h5>Code listing</h5>
|
|
||||||
{{if frame['lines']:}}
|
|
||||||
<pre>{{=CODE('\n'.join([x[1] for x in sorted(frame['lines'].items(),key=lambda x: x[0])]),
|
|
||||||
language='python', link=None, counter=min(frame['lines'].keys()), highlight_line=frame['lnum'])}}</pre>
|
|
||||||
{{pass}}
|
|
||||||
</div>
|
|
||||||
<div id="{{='%s_vars_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
|
|
||||||
<h5>Variables</h5>
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
{{for k,v in frame['dump'].items():}}
|
|
||||||
<tr>
|
|
||||||
<th>{{=k}}</th>
|
|
||||||
<td>{{=v}}</td>
|
|
||||||
</tr>
|
|
||||||
{{pass}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{{pass}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<!-- VIEW ENVIRONMENT -->
|
|
||||||
<div class="viewenv">
|
|
||||||
<h4><span>Context</span></h4>
|
|
||||||
<p class="controls">
|
|
||||||
<a class="button btn" onclick="jQuery('#locals').slideToggle()"><span>{{=T('locals')}}</span></a>
|
|
||||||
<a class="button btn" onclick="jQuery('#request').slideToggle()"><span>{{=T('request')}}</span></a>
|
|
||||||
<a class="button btn" onclick="jQuery('#session').slideToggle()"><span>{{=T('session')}}</span></a>
|
|
||||||
<a class="button btn" onclick="jQuery('#response').slideToggle()"><span>{{=T('response')}}</span></a>
|
|
||||||
</p>
|
|
||||||
<div class="hide inspect resp1" id="locals"><h6>locals</h6>
|
|
||||||
{{try:}}
|
|
||||||
{{=BEAUTIFY(snapshot['locals'])}}
|
|
||||||
{{except:}}
|
|
||||||
{{=BEAUTIFY('no locals available in snapshot')}}
|
|
||||||
{{pass}}
|
|
||||||
</div>
|
|
||||||
<div class="hide inspect" id="request"><h6>request</h6>
|
|
||||||
{{try:}}
|
|
||||||
{{=BEAUTIFY(snapshot['request'])}}
|
|
||||||
{{except:}}
|
|
||||||
{{=BEAUTIFY('no request available in snapshot')}}
|
|
||||||
{{pass}}
|
|
||||||
</div>
|
|
||||||
<div class="hide inspect" id="session"><h6>session</h6>
|
|
||||||
{{try:}}
|
|
||||||
{{=BEAUTIFY(snapshot['session'])}}
|
|
||||||
{{except:}}
|
|
||||||
{{=BEAUTIFY('no session available in snapshot')}}
|
|
||||||
{{pass}}
|
|
||||||
</div>
|
|
||||||
<div class="hide inspect" id="response"><h6>response</h6>
|
|
||||||
{{try:}}
|
|
||||||
{{=BEAUTIFY(snapshot['response'])}}
|
|
||||||
{{except:}}
|
|
||||||
{{=BEAUTIFY('no response available in snapshot')}}
|
|
||||||
{{pass}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{except Exception, e:}}
|
|
||||||
<!-- this should not happen, just in case... (cannot output normal hmtl as we don't know current open tags) -->
|
|
||||||
{{import traceback;tb=traceback.format_exc().replace("\n","\\n") }}
|
|
||||||
<script language='javascript'>alert("Exception during snapshot rendering: {{=tb}} ");</script>
|
|
||||||
{{pass}}
|
|
||||||
{{pass}}
|
|
||||||
<div class="errorsource">
|
|
||||||
<h3>In file: {{=layer}}</h3>
|
|
||||||
{{=CODE(code.replace('\r',''),language='python',link='/examples/global/vars/')}}
|
|
||||||
</div>
|
</div>
|
||||||
{{else:}}
|
<div id="{{='%s_code_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
|
||||||
<h3>{{=T('Ticket Missing')}}</h3>
|
<h5>Code listing</h5>
|
||||||
|
{{if frame['lines']:}}
|
||||||
|
<pre>{{=CODE('\n'.join([x[1] for x in sorted(frame['lines'].items(),key=lambda x: x[0])]),
|
||||||
|
language='python', link=None, counter=min(frame['lines'].keys()), highlight_line=frame['lnum'])}}</pre>
|
||||||
|
{{pass}}
|
||||||
|
</div>
|
||||||
|
<div id="{{='%s_vars_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
|
||||||
|
<h5>Variables</h5>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
{{for k,v in frame['dump'].items():}}
|
||||||
|
<tr>
|
||||||
|
<th>{{=k}}</th>
|
||||||
|
<td>{{=v}}</td>
|
||||||
|
</tr>
|
||||||
|
{{pass}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{pass}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- VIEW ENVIRONMENT -->
|
||||||
|
<div class="viewenv">
|
||||||
|
<h4><span>Context</span></h4>
|
||||||
|
<p class="controls">
|
||||||
|
<a class="button btn" onclick="jQuery('#locals').slideToggle()"><span>{{=T('locals')}}</span></a>
|
||||||
|
<a class="button btn" onclick="jQuery('#request').slideToggle()"><span>{{=T('request')}}</span></a>
|
||||||
|
<a class="button btn" onclick="jQuery('#session').slideToggle()"><span>{{=T('session')}}</span></a>
|
||||||
|
<a class="button btn" onclick="jQuery('#response').slideToggle()"><span>{{=T('response')}}</span></a>
|
||||||
|
</p>
|
||||||
|
<div class="hide inspect resp1" id="locals"><h4>locals</h4>
|
||||||
|
{{=BEAUTIFY(snapshot.get('locals','no locals available in snapshot'))}}
|
||||||
|
</div>
|
||||||
|
<div class="hide inspect" id="request"><h4>request</h4>
|
||||||
|
{{=XML(snapshot.get('request','no request available in snapshot'))}}
|
||||||
|
</div>
|
||||||
|
<div class="hide inspect" id="session"><h4>session</h4>
|
||||||
|
{{=XML(snapshot.get('session','no session available in snapshot'))}}
|
||||||
|
</div>
|
||||||
|
<div class="hide inspect" id="response"><h4>response</h4>
|
||||||
|
{{=XML(snapshot.get('response','no response available in snapshot'))}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{except Exception, e:}}
|
||||||
|
<!-- this should not happen, just in case... (cannot output normal hmtl as we don't know current open tags) -->
|
||||||
|
{{import traceback;tb=traceback.format_exc().replace("\n","\\n") }}
|
||||||
|
<script language='javascript'>alert("Exception during snapshot rendering: {{=tb}} ");</script>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
<!-- end "ticket" block -->
|
{{pass}}
|
||||||
|
|
||||||
|
<div class="errorsource">
|
||||||
|
<h3>In file: {{=layer}}</h3>
|
||||||
|
{{=CODE(code.replace('\r',''),language='python',link='/examples/global/vars/')}}
|
||||||
|
</div>
|
||||||
|
{{else:}}
|
||||||
|
<h3>{{=T('Ticket Missing')}}</h3>
|
||||||
|
{{pass}}
|
||||||
|
<!-- end "ticket" block -->
|
||||||
|
|||||||
+2
-2
@@ -2243,9 +2243,9 @@ class BEAUTIFY(DIV):
|
|||||||
for c in self.components:
|
for c in self.components:
|
||||||
if hasattr(c, 'value') and not callable(c.value):
|
if hasattr(c, 'value') and not callable(c.value):
|
||||||
if c.value:
|
if c.value:
|
||||||
components.append(c.value)
|
components.append(c.value)
|
||||||
if hasattr(c, 'xml') and callable(c.xml):
|
if hasattr(c, 'xml') and callable(c.xml):
|
||||||
components.append(c)
|
c = str(c)
|
||||||
continue
|
continue
|
||||||
elif hasattr(c, 'keys') and callable(c.keys):
|
elif hasattr(c, 'keys') and callable(c.keys):
|
||||||
rows = []
|
rows = []
|
||||||
|
|||||||
+3
-3
@@ -16,7 +16,7 @@ import logging
|
|||||||
|
|
||||||
from storage import Storage
|
from storage import Storage
|
||||||
from http import HTTP
|
from http import HTTP
|
||||||
from html import BEAUTIFY
|
from html import BEAUTIFY, XML
|
||||||
|
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ class RestrictedError(Exception):
|
|||||||
try:
|
try:
|
||||||
self.traceback = traceback.format_exc()
|
self.traceback = traceback.format_exc()
|
||||||
except:
|
except:
|
||||||
self.traceback = 'no traceback because template parting error'
|
self.traceback = 'no traceback because template parsing error'
|
||||||
try:
|
try:
|
||||||
self.snapshot = snapshot(context=10, code=code,
|
self.snapshot = snapshot(context=10, code=code,
|
||||||
environment=self.environment)
|
environment=self.environment)
|
||||||
@@ -319,6 +319,6 @@ def snapshot(info=None, context=5, code=None, environment=None):
|
|||||||
# add web2py environment variables
|
# add web2py environment variables
|
||||||
for k, v in environment.items():
|
for k, v in environment.items():
|
||||||
if k in ('request', 'response', 'session'):
|
if k in ('request', 'response', 'session'):
|
||||||
s[k] = BEAUTIFY(v)
|
s[k] = XML(str(BEAUTIFY(v)))
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|||||||
+1
-1
@@ -5091,7 +5091,7 @@ class Wiki(object):
|
|||||||
'%(slug)s')),
|
'%(slug)s')),
|
||||||
comment=current.T(
|
comment=current.T(
|
||||||
"Choose Template or empty for new Page")))
|
"Choose Template or empty for new Page")))
|
||||||
form = SQLFORM.factory(*fields, _class="well span6")
|
form = SQLFORM.factory(*fields, **dict(_class="well span6"))
|
||||||
form.element("[type=submit]").attributes["_value"] = \
|
form.element("[type=submit]").attributes["_value"] = \
|
||||||
current.T("Create Page from Slug")
|
current.T("Create Page from Slug")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user