def locateChild(self, ctx, segments): if segments[0]=='js': s=list(segments) p=website.child(s.pop(0)) while p.exists() and s: p=p.child(s.pop(0)) if p.exists: if p.isdir(): return DirectoryLister(p.path), () return File(p.path), s else: return LivePage.locateChild(self, ctx, segments) if segments[0] == '': return self, () return LivePage.locateChild(self, ctx, segments)