diff --git a/VERSION b/VERSION index 009d60ba..8a735101 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2012.12.26.11.43.58 +Version 2.4.1-alpha.2+timestamp.2012.12.26.11.54.07 diff --git a/applications/admin/static/js/ajax_editor.js b/applications/admin/static/js/ajax_editor.js index df1465fa..b24b2fd0 100644 --- a/applications/admin/static/js/ajax_editor.js +++ b/applications/admin/static/js/ajax_editor.js @@ -180,9 +180,16 @@ function doToggleBreakpoint(filename, url) { if (json.error) { window.location.href=json.redirect; } else { - // mark the breakpoint if ok=True - // remove mark if ok=False - // do nothing if ok = null + if (json.ok==true && window.mirror) { + // mark the breakpoint if ok=True + editor.setMarker(json.lineno-1, + " %N%") + } else if (json.ok==false && window.mirror) { + // remove mark if ok=False + editor.setMarker(json.lineno-1, "%N%") + } else { + // do nothing if ok = null + } // alert(json.ok + json.lineno); } } catch(e) { on_error(); } diff --git a/applications/admin/views/debug/breakpoints.html b/applications/admin/views/debug/breakpoints.html index 511b3724..557f0bab 100644 --- a/applications/admin/views/debug/breakpoints.html +++ b/applications/admin/views/debug/breakpoints.html @@ -1,114 +1,137 @@ {{extend 'layout.html'}} - {{block sectionclass}}debug{{end}} - - - - - -
-
- -

{{=T("Breakpoints")}}

- -
-
- - -

- - - - - - - - - - - - - - - - {{for bp in breakpoints:}} - - - - - - - - - - - - {{pass}} - -
{{=T("Delete")}}{{=T("Filename")}}{{=T("LineNo")}}{{=T("Temporary")}}{{=T("Condition")}}{{=T("Hits")}}
{{=bp['filename']}}{{=A(bp['lineno'],_href="#",_onclick="collapse('%s');" % bp['number'])}}{{=bp['temporary']}}{{=bp['condition']}}{{=bp['hits']}}
-
- {{=CODE(open(bp['path']).read(), language='python', - link=None, highlight_line=bp['lineno'], context_lines=10)}} +{{ +frm_trs = form.elements('tr') + tbl_rows = [] + for frm_tr in frm_trs: + if frm_tr['_id'] != 'submit_record__row': + fld_label = frm_tr.element('td.w2p_fl') + fld_widget = frm_tr.element('td.w2p_fw')[0] + fld_comment = frm_tr.element('td.w2p_fc')[0] + lbls = fld_label.elements('label') + lbl = '' + if len(lbls) > 0: + lbl = fld_label.elements('label')[0] + lbl['_class'] = 'control-label' + pass + if fld_widget['_type'] == 'checkbox': + fld_widget = LABEL(fld_widget, _class='checkbox') + else: + fld_widget = CAT(fld_widget, SPAN('', _class='help-inline')) + pass + if isinstance(fld_widget, SPAN): + fld_widget['_role'] = 'asinput' + pass + tbl_row = DIV(lbl, DIV(fld_widget, + TAG['SMALL'](fld_comment, + _class='help-block'), + _class='controls'), _class='control-group') + tbl_rows.append(tbl_row) + else: + smt_btn = frm_tr.element('td.w2p_fw') + btn = smt_btn.elements('input')[0] + btn['_class'] = 'btn btn-primary' + tbl_rows.append(DIV(btn, _class='controls')) + pass + pass + form.element('table', replace=CAT(*tbl_rows)) + form['_class'] = 'form-horizontal well well-small' + import re + if form.errors: + for key, value in form.errors.iteritems(): + inpt = form.element(_name=key) + inpt_wrapper = inpt.parent + if inpt_wrapper['_class'] == None or \ + not "controls" in inpt_wrapper['_class']: + inpt_wrapper = inpt_wrapper.parent + pass + inpt_wrapper.parent['_class'] += ' error' + inpt_wrapper.element(_class=re.compile('help-inline'), + replace=lambda me:SPAN(value, _class=me['_class'])) + pass + form.errors.clear() + pass +}} + +
+
+
+

{{=T("Breakpoints")}}

+
+ +
+ +
+
+
+ + + + + + + + + + + + + {{for bp in breakpoints:}} + + + + + + + + + + + + {{pass}} + +
{{=T("Filename")}}{{=T("Line Nr")}}{{=T("Temporary")}}{{=T("Condition")}}{{=T("Hits")}}
{{=bp['filename']}}{{=A(bp['lineno'],_href="#",_onclick="collapse('%s');" % bp['number'])}}{{=bp['temporary']}}{{=bp['condition']}}{{=bp['hits']}}
+
+ {{=CODE(open(bp['path']).read(), language='python', + link=None, highlight_line=bp['lineno'], context_lines=10)}} +
+
+
+
+
-
- - +
+
+
- -
- -
- - - - - - - - + + + diff --git a/applications/admin/views/debug/interact.html b/applications/admin/views/debug/interact.html index 585c7e1e..cd2bf790 100644 --- a/applications/admin/views/debug/interact.html +++ b/applications/admin/views/debug/interact.html @@ -1,246 +1,191 @@ {{extend 'layout.html'}} - {{block sectionclass}}debug{{end}} - - - -
-
-

{{=T("web2py online debugger")}}

- - {{if filename:}} -

{{=T("Interaction at %s line %s") % (filename, lineno)}}

+ +
+
+
+

{{=T("web2py online debugger")}}

+ {{if filename:}} +

{{=T("Interaction at %s line %s") % (filename, lineno)}}

+ {{if exception:}} +

{{=T("Exception %s", exception['title'])}}

+ {{pass}} +
{{=T("Code listing")}}
+ {{if lines:}}
+
{{=CODE('\n'.join([x[1] for x in sorted(lines.items(),key=lambda x: x[0])]),
+                        language='python', link=None, counter=min(lines.keys()), 
+                        highlight_line=lineno, context_lines=10)}}
+ {{pass}} +
+
+
    +
  • {{=T("Your application will be blocked until you click an action button (next, step, continue, etc.)")}}
  • +
  • {{=T("Your can inspect variables using the console below")}}
  • +
+
+
+

{{=T("Interactive console")}}

+
+
+
+ +
+
+ +
+ {{elif request.env.get('wsgi_multiprocess') or not request.env.get('wsgi_multithread'):}} +

{{=T("Unsupported webserver working mode: %s", request.env.get('server_software', ''))}}

+
+
    +
  • {{=T("WARNING:")}} {{=T("This debugger may not work properly if you don't have a threaded webserver or you're using multiple daemon processes.")}}
  • +
  • {{=T("In development, use the default Rocket webserver that is currently supported by this debugger.")}}
  • +
  • {{=T("On production, you'll have to configure your webserver to use one process and multiple threads to use this debugger.")}}
  • +
+
+ {{#=BEAUTIFY(request.env)}} + {{else:}} +

{{=T("No Interaction yet")}}

+
+
    +
  • {{=T("You need to set up and reach a")}} {{=A(T("breakpoint"), _href=URL('breakpoints'))}} {{=T('to use the debugger!')}}
  • +
  • {{=T('To emulate a breakpoint programatically, write:')}} + {{=CODE("from gluon.debug import dbg\n" + "dbg.set_trace() # stop here!\n", + counter=None)}}
  • +
  • {{=T('Please')}} {{=A(T("refresh"), _href=URL('interact'))}} {{=T('this page to see if a breakpoint was hit and debug interaction is required.')}}
  • +
+
+ {{pass}} +
+
+ - - - - +