示例#1
0
文件: storage.py 项目: samveen/dwiki
 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)
示例#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)
示例#3
0
文件: views.py 项目: samveen/dwiki
	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