twisted.web.error.MissingRenderMethod

Here are the examples of the python api twisted.web.error.MissingRenderMethod taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: SubliminalCollaborator Source File: test_template.py
    def test_missingRenderMethodRepr(self):
        """
        A L{MissingRenderMethod} instance can be repr()'d without error.
        """
        class PrettyReprElement(Element):
            def __repr__(self):
                return 'Pretty Repr Element'
        s = repr(MissingRenderMethod(PrettyReprElement(),
                                     'expectedMethod'))
        self.assertIn('Pretty Repr Element', s)
        self.assertIn('expectedMethod', s)

Example 2

Project: SubliminalCollaborator Source File: _element.py
Function: lookuprendermethod
    def lookupRenderMethod(self, name):
        """
        Look up and return the named render method.
        """
        method = renderer.get(self, name, None)
        if method is None:
            raise MissingRenderMethod(self, name)
        return method