Beispiel #1
0
	def query(self,sql):
		#if D: log.debug("Executing with sql='%s' and dictionary=%s",sql,dictionary)
		#if acconfig.config.has_key("debug") and acconfig.config["debug"]:
		#	import time
		#	t=time.time()
		cursor=self.conn.cursor()
		try:
			cursor.execute(sql)
			#self.conn.commit()
		except Exception ,e:
			#if D: log.error("SQLError %s",str(e))
			raise Error("SQLError", escapeQuotes(str(e))+": "+str(sql))
Beispiel #2
0
def parseCookies(acenv,s):
	"""
	input: key=val;key=val
	returns: d={name:val}
	"""
	D = acenv.doDebug
	if D: acenv.debug("parseCookies '%s'",s)
	t=str(s).split(";")
	d={}
	for i in t:
		t2=i.split("=")
		t2[0]=t2[0].strip()
		if t2[0].startswith(acenv.prefix):
			#delete escapeQuotes
			d[t2[0]]=escapeQuotes(urllib.unquote(t2[1].replace("+"," ")))
	return d