equal
deleted
inserted
replaced
15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 |
18 |
19 from pyramid_debugtoolbar.panels import DebugPanel |
19 from pyramid_debugtoolbar.panels import DebugPanel |
|
20 |
20 from cubicweb.debug import subscribe_to_debug_channel, unsubscribe_to_debug_channel |
21 from cubicweb.debug import subscribe_to_debug_channel, unsubscribe_to_debug_channel |
21 from cubicweb.misc.source_highlight import highlight_html, generate_css |
22 from cubicweb.misc.source_highlight import highlight_html, generate_css |
22 |
23 |
23 |
24 |
24 class CubicWebDebugPanel(DebugPanel): |
25 class CubicWebDebugPanel(DebugPanel): |
42 |
43 |
43 has_content = True |
44 has_content = True |
44 template = 'cubicweb.pyramid:debug_toolbar_templates/cw.dbtmako' |
45 template = 'cubicweb.pyramid:debug_toolbar_templates/cw.dbtmako' |
45 |
46 |
46 def __init__(self, request): |
47 def __init__(self, request): |
47 self.data = {'controller': None} |
48 self.data = { |
|
49 'controller': None, |
|
50 'source_code_url': source_code_url, |
|
51 } |
|
52 |
48 subscribe_to_debug_channel("controller", self.collect_controller) |
53 subscribe_to_debug_channel("controller", self.collect_controller) |
49 |
54 |
50 def collect_controller(self, controller): |
55 def collect_controller(self, controller): |
51 self.data["controller"] = controller |
56 self.data["controller"] = controller |
52 |
57 |
71 self.data = { |
76 self.data = { |
72 'registry_decisions': [], |
77 'registry_decisions': [], |
73 'vreg': None, |
78 'vreg': None, |
74 'highlight': highlight_html, |
79 'highlight': highlight_html, |
75 'generate_css': generate_css, |
80 'generate_css': generate_css, |
|
81 'source_code_url': source_code_url, |
76 } |
82 } |
77 |
83 |
78 subscribe_to_debug_channel("vreg", self.collect_vreg) |
84 subscribe_to_debug_channel("vreg", self.collect_vreg) |
79 subscribe_to_debug_channel("registry_decisions", self.collect_registry_decisions) |
85 subscribe_to_debug_channel("registry_decisions", self.collect_registry_decisions) |
80 |
86 |
118 |
124 |
119 has_content = True |
125 has_content = True |
120 template = 'cubicweb.pyramid:debug_toolbar_templates/registry.dbtmako' |
126 template = 'cubicweb.pyramid:debug_toolbar_templates/registry.dbtmako' |
121 |
127 |
122 def __init__(self, request): |
128 def __init__(self, request): |
123 self.data = {'vreg': None} |
129 self.data = { |
|
130 'vreg': None, |
|
131 'source_code_url': source_code_url, |
|
132 } |
124 subscribe_to_debug_channel("vreg", self.collect_vreg) |
133 subscribe_to_debug_channel("vreg", self.collect_vreg) |
125 |
134 |
126 def collect_vreg(self, message): |
135 def collect_vreg(self, message): |
127 self.data["vreg"] = message["vreg"] |
136 self.data["vreg"] = message["vreg"] |
128 |
137 |