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
3
Example 1
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
0
Example 2
def _getChild(self, resource, path, request):
return resource.getChildWithDefault(path, request)
0
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)