Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
3cbcbaead477
Commit
621b07a9
authored
Sep 27, 2019
by
Laurent Peuch
Browse files
[debug-toolbar] link to source code of all objects/classes
Closes #17256791
parent
38f22b8b4459
Changes
4
Hide whitespace changes
Inline
Side-by-side
cubicweb/pyramid/debug_toolbar_templates/cw.dbtmako
View file @
3cbcbaea
...
...
@@ -12,9 +12,9 @@
<tbody>
<tr>
<td>${controller["kind"]}</td>
<td>${controller["request"]}</td>
<td>${controller["request"]}
${source_code_url(controller["request"]) | n}
</td>
<td>${controller["path"]}</td>
<td>${controller["controller"]}</td>
<td>${controller["controller"]}
${source_code_url(controller["controller"]) | n}
</td>
</tr>
</tbody>
</table>
...
...
cubicweb/pyramid/debug_toolbar_templates/registry.dbtmako
View file @
3cbcbaea
...
...
@@ -30,7 +30,7 @@
% else:
${value}
% endif
${source_code_url(value) | n}
<ul>
% if hasattr(value, "cw_etype"):
<li>regid: '${value.cw_etype}'</li>
...
...
cubicweb/pyramid/debug_toolbar_templates/registry_decisions.dbtmako
View file @
3cbcbaea
...
...
@@ -14,7 +14,7 @@
<tr></tr>
% for registry_decision in registry_decisions:
<tr>
<td colspan="2"><b>${repr(registry_decision["key"])} -> ${render_object(registry_decision["winner"])}</b></td>
<td colspan="2"><b>${repr(registry_decision["key"])} -> ${render_object(registry_decision["winner"])}
${source_code_url(registry_decision["winner"]) | n}
</b></td>
</tr>
<tr>
<td>
...
...
@@ -33,7 +33,7 @@
<ul>
% for obj in registry_decision["all_objects"]:
<li>
${obj["score"]}: ${render_object(obj["object"])}
${obj["score"]}: ${render_object(obj["object"])}
${source_code_url(obj["object"]) | n}
</li>
% endfor
</ul>
...
...
cubicweb/pyramid/debugtoolbar_panels.py
View file @
3cbcbaea
...
...
@@ -17,6 +17,7 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
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
...
...
@@ -44,7 +45,11 @@ class CubicWebDebugPanel(DebugPanel):
template
=
'cubicweb.pyramid:debug_toolbar_templates/cw.dbtmako'
def
__init__
(
self
,
request
):
self
.
data
=
{
'controller'
:
None
}
self
.
data
=
{
'controller'
:
None
,
'source_code_url'
:
source_code_url
,
}
subscribe_to_debug_channel
(
"controller"
,
self
.
collect_controller
)
def
collect_controller
(
self
,
controller
):
...
...
@@ -73,6 +78,7 @@ class RegistryDecisionsDebugPanel(DebugPanel):
'vreg'
:
None
,
'highlight'
:
highlight_html
,
'generate_css'
:
generate_css
,
'source_code_url'
:
source_code_url
,
}
subscribe_to_debug_channel
(
"vreg"
,
self
.
collect_vreg
)
...
...
@@ -120,7 +126,10 @@ class RegistryDebugPanel(DebugPanel):
template
=
'cubicweb.pyramid:debug_toolbar_templates/registry.dbtmako'
def
__init__
(
self
,
request
):
self
.
data
=
{
'vreg'
:
None
}
self
.
data
=
{
'vreg'
:
None
,
'source_code_url'
:
source_code_url
,
}
subscribe_to_debug_channel
(
"vreg"
,
self
.
collect_vreg
)
def
collect_vreg
(
self
,
message
):
...
...
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