def handle(self,ri): if ri.isFinal and ri.thisComp == 'startDemo': return common.getResult(resume.DepartmentInfo.handle_startDemo()) elif ri.isFinal: dept = resume.DepartmentInfo.selectBy(shortname=ri.thisComp) if dept.count() > 0: return common.HttpResult('Moved Permanently',status=301,Location=ri.req.uri+'/') if ri.thisComp == '': return common.HttpFileResult(os.path.join(config.serverRoot,'static-base','index.html')) return common.handleFile(os.path.join(config.serverRoot,'static-base'),ri)
def handle(self,ri): if ri.isFinal and ri.thisComp == '': return common.HttpFileResult(os.path.join(config.serverRoot,'static','login.html')) if ri.isFinal: try: return common.ObjHandler.handle(self,ri) except common.HandlerException: pass if ri.thisComp[:7] == 'letter-' and ri.thisComp[-4:] == '.pdf': return common.getResult(ri.extras['dept'].handle_getLetter(id=int(ri.thisComp[7:-4]))) return common.handleFile(os.path.join(config.serverRoot,'static'),ri)