def __init__(self, name): self.back = backend(name)
#!/usr/bin/env python import cgi form = cgi.FieldStorage() import cgitb cgitb.enable() print "Content-type: text/html" print from backend_sqlite import backend back = backend('env1.db') # set variables if 'Eid' in form: Eid = int(form.getfirst('Eid')) else: Eid = 0 if 'Evalue' in form: Evalue = form.getfirst('Evalue') else: Evalue = back.getEValue(Eid) if 'Etypetag' in form: Etypetag = form.getfirst('Etypetag') else: Etypetag = back.getETypetag(Eid) if 'Etags' in form: Etags = form.getfirst('Etags') else: Etags = back.getETags(Eid) if 'Cid' in form: Cid = int(form.getfirst('Cid')) else: try: Cid = back.getEConnections(Eid)[0] except: Cid = -1 if 'Ctypetag' in form: Ctypetag = form.getfirst('Ctypetag') else: Ctypetag = back.getCTypetag(Cid) if 'Ctags' in form: Ctags = form.getfirst('Ctags') else: Ctags = back.getCTags(Cid)