merged with Mariano's branch (inlucdes better debug.py and ace editor
This commit is contained in:
@@ -166,14 +166,19 @@ def toggle_breakpoint():
|
||||
try:
|
||||
filename = os.path.join(request.env['applications_parent'],
|
||||
'applications', request.vars.filename)
|
||||
start = 0
|
||||
sel_start = int(request.vars.sel_start)
|
||||
for lineno, line in enumerate(request.vars.data.split("\n")):
|
||||
if sel_start <= start:
|
||||
break
|
||||
start += len(line) + 1
|
||||
if not request.vars.data:
|
||||
# ace send us the line number!
|
||||
lineno = int(request.vars.sel_start) + 1
|
||||
else:
|
||||
lineno = None
|
||||
# editarea send us the offset, manually check the cursor pos
|
||||
start = 0
|
||||
sel_start = int(request.vars.sel_start)
|
||||
for lineno, line in enumerate(request.vars.data.split("\n")):
|
||||
if sel_start <= start:
|
||||
break
|
||||
start += len(line) + 1
|
||||
else:
|
||||
lineno = None
|
||||
if lineno is not None:
|
||||
for bp in qdb_debugger.do_list_breakpoint():
|
||||
no, bp_filename, bp_lineno, temporary, enabled, hits, cond = bp
|
||||
|
||||
@@ -220,12 +220,15 @@ def site():
|
||||
def pack():
|
||||
app = get_app()
|
||||
|
||||
if len(request.args) == 1:
|
||||
fname = 'web2py.app.%s.w2p' % app
|
||||
filename = app_pack(app, request)
|
||||
else:
|
||||
fname = 'web2py.app.%s.compiled.w2p' % app
|
||||
filename = app_pack_compiled(app, request)
|
||||
try:
|
||||
if len(request.args) == 1:
|
||||
fname = 'web2py.app.%s.w2p' % app
|
||||
filename = app_pack(app, request, raise_ex=True)
|
||||
else:
|
||||
fname = 'web2py.app.%s.compiled.w2p' % app
|
||||
filename = app_pack_compiled(app, request, raise_ex=True)
|
||||
except Exception, e:
|
||||
filename = None
|
||||
|
||||
if filename:
|
||||
response.headers['Content-Type'] = 'application/w2p'
|
||||
@@ -233,7 +236,7 @@ def pack():
|
||||
response.headers['Content-Disposition'] = disposition
|
||||
return safe_read(filename, 'rb')
|
||||
else:
|
||||
session.flash = T('internal error')
|
||||
session.flash = T('internal error: %s' % e)
|
||||
redirect(URL('site'))
|
||||
|
||||
def pack_plugin():
|
||||
@@ -479,7 +482,7 @@ def edit():
|
||||
offset = e.offset - (len(e.text) - len(e.text.splitlines()[-1]))
|
||||
else:
|
||||
offset = 0
|
||||
highlight = {'start': start, 'end': start + offset + 1}
|
||||
highlight = {'start': start, 'end': start + offset + 1, 'lineno': e.lineno}
|
||||
try:
|
||||
ex_name = e.__class__.__name__
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user