[pyramid_debugtoolbar] add links to files in tracebacks draft
authorLaurent Peuch <cortex@worlddomination.be>
Fri, 27 Sep 2019 07:06:49 +0200
changeset 13437 1115ff750878
parent 13436 5b957bd567da
child 13438 a9f8fd44456e
[pyramid_debugtoolbar] add links to files in tracebacks
cubicweb/pyramid/debug_toolbar_templates/rql.dbtmako
cubicweb/pyramid/debug_toolbar_templates/sql.dbtmako
cubicweb/pyramid/debugtoolbar_panels.py
--- a/cubicweb/pyramid/debug_toolbar_templates/rql.dbtmako	Fri Sep 27 07:00:51 2019 +0200
+++ b/cubicweb/pyramid/debug_toolbar_templates/rql.dbtmako	Fri Sep 27 07:06:49 2019 +0200
@@ -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")) | n}</pre>
                 </td>
             </tr>
             <tr style="display: none"></tr> <!-- css hack because of previous hidden tr for -stripped -->
--- a/cubicweb/pyramid/debug_toolbar_templates/sql.dbtmako	Fri Sep 27 07:00:51 2019 +0200
+++ b/cubicweb/pyramid/debug_toolbar_templates/sql.dbtmako	Fri Sep 27 07:06:49 2019 +0200
@@ -30,7 +30,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")) | n}</pre>
                 </td>
             </tr>
             <tr style="display: none"></tr> <!-- css hack because of previous hidden tr for -stripped -->
--- a/cubicweb/pyramid/debugtoolbar_panels.py	Fri Sep 27 07:00:51 2019 +0200
+++ b/cubicweb/pyramid/debugtoolbar_panels.py	Fri Sep 27 07:06:49 2019 +0200
@@ -403,6 +403,7 @@
             'rql_queries': self.rql_queries[:],
             'highlight': highlight_html,
             'generate_css': generate_css,
+            'source_code_url_in_stack': source_code_url_in_stack,
         }
         self.link_sql_queries_to_rql_queries()
         self.rql_queries = []
@@ -480,6 +481,7 @@
             'sql_queries': self.sql_queries[:],
             'highlight': highlight_html,
             'generate_css': generate_css,
+            'source_code_url_in_stack': source_code_url_in_stack,
         }
         self.link_rql_queries_to_sql_queries()
         self.rql_queries = []