Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
7c4216ed7497
Commit
379d3a01
authored
Nov 26, 2019
by
Laurent Peuch
Browse files
[debug-toolbar/display_source_code] add links to files in tracebacks
parent
3cbcbaead477
Changes
3
Hide whitespace changes
Inline
Side-by-side
cubicweb/pyramid/debug_toolbar_templates/rql.dbtmako
View file @
7c4216ed
...
...
@@ -47,7 +47,7 @@
</tr>
<tr style="display: none" id="stack-${i}">
<td colspan="7">
<pre>${highlight(query["callstack"], "py3tb", linenos="inline") | n}</pre>
<pre>${
source_code_url_in_stack(
highlight(query["callstack"], "py3tb", linenos="inline")
, highlighted=has_pygments)
| n}</pre>
</td>
</tr>
<tr style="display: none"></tr> <!-- css hack because of previous hidden tr for -stripped -->
...
...
cubicweb/pyramid/debug_toolbar_templates/sql.dbtmako
View file @
7c4216ed
...
...
@@ -29,7 +29,7 @@
</tr>
<tr style="display: none" id="sql-stack-${i}">
<td colspan="6">
<pre>${highlight(query["callstack"], "py3tb", linenos="inline") | n}</pre>
<pre>${
source_code_url_in_stack(
highlight(query["callstack"], "py3tb", linenos="inline")
, highlighted=has_pygments)
| n}</pre>
</td>
</tr>
<tr style="display: none"></tr> <!-- css hack because of previous hidden tr for -stripped -->
...
...
cubicweb/pyramid/debugtoolbar_panels.py
View file @
7c4216ed
...
...
@@ -19,7 +19,8 @@
from
pyramid_debugtoolbar.panels
import
DebugPanel
from
cubicweb.debug
import
subscribe_to_debug_channel
,
unsubscribe_to_debug_channel
from
cubicweb.misc.source_highlight
import
highlight_html
,
generate_css
from
cubicweb.misc.source_highlight
import
highlight_html
,
generate_css
,
has_pygments
from
cubicweb.pyramid.debug_source_code
import
source_code_url
,
source_code_url_in_stack
class
CubicWebDebugPanel
(
DebugPanel
):
...
...
@@ -169,6 +170,8 @@ class RQLDebugPanel(DebugPanel):
'sql_queries'
:
[],
'highlight'
:
highlight_html
,
'generate_css'
:
generate_css
,
'has_pygments'
:
has_pygments
,
'source_code_url_in_stack'
:
source_code_url_in_stack
,
}
subscribe_to_debug_channel
(
"rql"
,
self
.
collect_rql_queries
)
subscribe_to_debug_channel
(
"sql"
,
self
.
collect_sql_queries
)
...
...
@@ -225,6 +228,8 @@ class SQLDebugPanel(DebugPanel):
'sql_queries'
:
[],
'highlight'
:
highlight_html
,
'generate_css'
:
generate_css
,
'has_pygments'
:
has_pygments
,
'source_code_url_in_stack'
:
source_code_url_in_stack
,
}
subscribe_to_debug_channel
(
"rql"
,
self
.
collect_rql_queries
)
subscribe_to_debug_channel
(
"sql"
,
self
.
collect_sql_queries
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment