Member Avatar

import web,re,traceback urls=( "/","displaythreads" "/viewthread","displaythreads", "/viewthread/(.*)","displaythread", "/viewthread/(.*)/Vote/(Up|Down)","vote", "/newthread/(.*)","newthread", "/newthread","newthread" ) entries={}###{entryname:{property:value}} entrylength=0 class displaythreads: pass class newthread: template=web.template.frender("newthread.html") default=template("DEFAULT",0) def initialize(): pass def GET(): return default def POST(): data = web.input() try: username,threadname = data.username,data.threadname except: return template(mode) if threadname in entries: return template("Exists") entries[threadname]={"creator":username,"points":0,"totvotes":0} class displaythread: template=web.template.frender('Thread Viewer Template.html') def initialize(): pass def GET(self): return self.template( entrylength, entries.keys(), [value['name'] for value in entries.values()] ) class vote: template=web.template.frender('vote.html') def initialize(): pass def GET(self,thread,vote): try: current=web.cookies().get("Voted:"+thread) except: current="BEING DELETED" #act like it is being deleted if its not there. ######Set cookies and change votes######### ##Removing/Adding an extra vote if it was …

Member Avatar
0
13
Member Avatar

Hi guys, when I process some images (where apparently the dpi info is missing for python) I get a Keyerror: 'dpi'. Is there an easy way to capture this error or set the dpi to 72 if this info is not available? Thanks a lot

0
1

The End.