diff --git a/CHANGES.txt b/CHANGES.txt index 93ad8f0..a3bff28 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,10 +5,6 @@ unreleased the ``preprocessor`` will be wrapped in a function that invokes the preprocessor with pyramid's config settings as the second argument. -- Added a debugtoolbar panel for debugging use - debugtoolbar.panels = - pyramid_mako.debugtoolbar.panels.main.PyramidMakoMainDebugPanel - - `add_mako_renderer` now accepts a list of `extensions` instead of a single `extension`. This allows for multiple extensions to share a single lookup. Under the previous system, `.mako` and `.mak` would be registered to different diff --git a/pyramid_mako/debugtoolbar/__init__.py b/pyramid_mako/debugtoolbar/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pyramid_mako/debugtoolbar/panels/__init__.py b/pyramid_mako/debugtoolbar/panels/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pyramid_mako/debugtoolbar/panels/main.py b/pyramid_mako/debugtoolbar/panels/main.py deleted file mode 100644 index d21dc6d..0000000 --- a/pyramid_mako/debugtoolbar/panels/main.py +++ /dev/null @@ -1,24 +0,0 @@ -from pyramid_debugtoolbar.panels import DebugPanel -from pyramid_debugtoolbar.compat import text_ -from pyramid.interfaces import IRendererFactory -import pyramid_mako -_ = lambda x: x - - -class PyramidMakoMainDebugPanel(DebugPanel): - """ - A panel to display HTTP request and response headers. - """ - name = 'pyramid_mako' - has_content = True - template = 'pyramid_mako.debugtoolbar.panels:templates/main.dbtmako' - title = _('PyramidMako') - nav_title = title - - - def __init__(self, request): - self.registry = request.registry - all_renderers = request.registry.getAllUtilitiesRegisteredFor(IRendererFactory) - mako_renderers = [r for r in all_renderers if isinstance(r, pyramid_mako.MakoRendererFactory)] - self.mako_renderers = mako_renderers - self.data = {'mako_renderers': self.mako_renderers, } diff --git a/pyramid_mako/debugtoolbar/panels/templates/main.dbtmako b/pyramid_mako/debugtoolbar/panels/templates/main.dbtmako deleted file mode 100644 index ccfd60f..0000000 --- a/pyramid_mako/debugtoolbar/panels/templates/main.dbtmako +++ /dev/null @@ -1,48 +0,0 @@ -

Mako Renderers

- -% for renderer in mako_renderers: - - - - - - - - - - - - - ## - - - - - - - - - - ## - ## - ## - ## - ## -
renderer extensions${renderer.registered_extensions}
renderer${renderer}, ${id(renderer)}
lookup${renderer.lookup}, ${id(renderer.lookup)}${renderer.lookup.__dict__}
lookup directories - directories configured -
    - % for i in renderer.lookup.directories: -
  • ${i}
  • - % endfor -
-
lookup collection - templates that have already been loaded/compiled -
    - % for i in renderer.lookup._collection.keys(): -
  • ${i}
  • - % endfor -
-
renderer_factory${renderer.renderer_factory}${renderer.renderer_factory.__dict__}
-
- ## ${dir(renderer)} -% endfor diff --git a/pyramid_mako/tests.py b/pyramid_mako/tests.py index 7d2ba23..777c87b 100644 --- a/pyramid_mako/tests.py +++ b/pyramid_mako/tests.py @@ -641,32 +641,6 @@ def test_repr_and_str(self): self.assertEqual(str(exc), 'text') self.assertEqual(repr(exc), 'text') -class TestDebugtoolbarPanel(Base, unittest.TestCase): - - def test_panel_null(self): - # we shouldn't have any mako_renderers configured... but the panel should run - from pyramid_mako.debugtoolbar.panels.main import PyramidMakoMainDebugPanel - from pyramid.testing import DummyRequest - panel = PyramidMakoMainDebugPanel(DummyRequest()) - self.assertTrue('mako_renderers' in panel.data) - self.assertTrue(len(panel.data['mako_renderers']) == 0) - - def test_panel_full(self): - # we should have a single renders for .mako+.mak - from pyramid_mako.debugtoolbar.panels.main import PyramidMakoMainDebugPanel - from pyramid.testing import DummyRequest - self.config = testing.setUp() - self.settings = {'mako.directories': 'pyramid_mako.tests:fixtures', - 'mako.preprocessor': - 'pyramid_mako.tests.dummy_mako_preprocessor', - 'mako.preprocessor_wants_settings': 'true', - 'replace_Hello': 'Goodbye', - } - self.config.add_settings(self.settings) - self.config.include('pyramid_mako') - panel = PyramidMakoMainDebugPanel(DummyRequest()) - self.assertTrue('mako_renderers' in panel.data) - self.assertTrue(len(panel.data['mako_renderers']) == 1) class DummyLookup(object): directories = True