Skip to content

Commit

Permalink
fix(pserver): clarify StackedResource
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 6, 2020
1 parent 7350220 commit 1251669
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ def processEnded(self, reason):
class StackedResource(resource.Resource):
def __init__(self, stack):
super().__init__()
self.stack = stack
self.stack = [super(), *stack]

def getChildWithDefault(self, *args):
res = super().getChildWithDefault(*args)
i = 0
while isinstance(res, resource.NoResource) and i < len(self.stack):
res = self.stack[i].getChildWithDefault(*args)
i += 1
for s in self.stack:
res = s.getChildWithDefault(*args)
if not isinstance(res, resource.NoResource):
return res
return res

def wwwroot(home):
Expand Down

0 comments on commit 1251669

Please sign in to comment.