$(function() {
var sourceView = null;
/**
* if we are in console mode, show the console.
*/
if (CONSOLE_MODE && EVALEX) {
openShell(null, $('div.console div.inner').empty(), 0);
}
$('div.traceback div.frame').each(function() {
var
target = $('pre', this)
.click(function() {
sourceButton.click();
}),
consoleNode = null, source = null,
frameID = this.id.substring(6);
/**
* Add an interactive console to the frames
*/
if (EVALEX)
$('')
.attr('title', 'Open an interactive python shell in this frame')
.click(function() {
consoleNode = openShell(consoleNode, target, frameID);
return false;
})
.prependTo(target);
/**
* Show sourcecode
*/
var sourceButton = $('
')
.attr('title', 'Display the sourcecode for this frame')
.click(function() {
if (!sourceView)
$('h2', sourceView =
$('
To switch between the interactive traceback and the plaintext ' + 'one, you can click on the "Traceback" headline. From the text ' + 'traceback you can also create a paste of it. ' + (!EVALEX ? '' : 'For code execution mouse-over the frame you want to debug and ' + 'click on the console icon on the right side.' + '
You can execute arbitrary Python code in the stack frames and ' + 'there are some extra helpers available for introspection:' + '
dump()
shows all variables in the frame' +
'dump(obj)
dumps all that\'s known about the object').text(plainTraceback.text())); }); /** * Helper function for shell initialization */ function openShell(consoleNode, target, frameID) { if (consoleNode) return consoleNode.slideToggle('fast'); consoleNode = $('') .submit(function() { var cmd = command.val(); $.get('', { __debugger__: 'yes', cmd: cmd, frm: frameID, s: SECRET}, function(data) { var tmp = $('') .appendTo(target.parent()) .hide() var historyPos = 0, history = ['']; var output = $('[console ready]') .appendTo(consoleNode); var form = $('