twisted.web.resource.getChildWithDefault

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

3 Examples 7

Example 1

Project: txyoga Source File: util.py
Function: get_resource
    def _getResource(self, args=None, headers=None, path=()):
        """
        Generalized GET for a particular resource.
        """
        headers = headers or correctAcceptHeaders
        request = _FakeRequest(args=args, requestHeaders=headers)

        resource = self.resource
        for childName in path:
            resource = resource.getChildWithDefault(childName, request)

        d = self._makeRequest(resource, request)

        @d.addCallback
        def verify(_):
            self._checkContentType()
            self._decodeResponse()

        return d

Example 2

Project: txyoga Source File: resource.py
Function: get_child
    def _getChild(self, resource, path, request):
        return resource.getChildWithDefault(path, request)

Example 3

Project: SubliminalCollaborator Source File: test_web.py
    def getChildWithDefault(self, name, request):
        d = defer.succeed(self.default)
        resource = util.DeferredResource(d)
        return resource.getChildWithDefault(name, request)