Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
	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)
Exemplo n.º 3
0
	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