def exists(self, relname): # It is worth fast-casing this, because it avoids # an unnecessary bogusname check. jn = join2(self.root, relname) if jn in self.stcache: return bool(self.stcache[jn]) if utils.boguspath(relname): return False else: st = self.getStat(jn) return bool(st)
def page_ok(self): code = 404 if utils.boguspath(self.page.path): error = "badrequest" elif not utils.goodpath(self.page.path): error = "nopage" elif not self.page.exists(): error = "nopage" elif not self.page.displayable(): code = 503 if self.page.inconsistent(): error = "inconsistpage" else: error = "badpage" else: return True self.error(error, code) return False