def do_action(self, path, args): fileext = path[-5:] #print path,'==>', fileext if fileext.find('.') >= 0: # 'staticfile': self.static_file(path) return if path[-1] == '/': self.outputtxt(jessyPage()) return mpath, action = getaction(path) margs = transDicts(args) ## >> bottle if mpath == "msg": self.outputtxt(msg_chat(action, margs)) return if mpath == "tongji": # +++++ 统计 handsontable from tongji.tongji import calc self.outputtxt(calc.do_act(action, margs)) return if mpath == 'quit': if sys.platform[0] == 'l': self.outputtxt(u'''<br><h2><font color="#FF0000">需要关闭服务器:<br> 请在终端按Ctrl+C。<br>按“返回”继续</font></h2>''') else: self.outputtxt( u'<br><h1><font color="#FF0000">服务器已关闭</font></h1>') stophttp() else: self.send_error(404, "File not found - Error URL")
def do_action(self, path, args): fileext = path[-5:] #print path,'==>', fileext if fileext.find('.') >=0: # 'staticfile': self.static_file(path) return if path[-1] == '/': self.outputtxt(jessyPage()) return mpath, action = getaction(path) margs = transDicts(args) ## >> bottle if mpath == "msg": self.outputtxt( msg_chat(action, margs) ) return if mpath == "tongji": # +++++ 统计 handsontable from tongji.tongji import calc self.outputtxt( calc.do_act(action, margs)) return if mpath == 'quit': if sys.platform[0] == 'l': self.outputtxt(u'''<br><h2><font color="#FF0000">需要关闭服务器:<br> 请在终端按Ctrl+C。<br>按“返回”继续</font></h2>''') else: self.outputtxt(u'<br><h1><font color="#FF0000">服务器已关闭</font></h1>') stophttp() else: self.send_error(404, "File not found - Error URL")
def to_module(whichmod, action, form): ## myserver main if whichmod == "tongji": # +++++ 统计 handsontable from tongji.tongji import calc tongji_path = join(BASE_DIR, 'tongji') return calc.do_act(action, form) elif whichmod in TIKU: return TIKU[whichmod].do_act(action, form) else: return