Beispiel #1
0
 def GET(self, args=None):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
             
     title, header, footer = getHeaderFooter("base64") 
     return render.base64Page(title, header, footer, None, None)      
 def POST(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     postData = web.input();
     operate = postData.get("operate");
     trans_code = postData.get("trans_code")
     format_code = postData.get("format_code")
     c_format = postData.get("c_format")
     send_example = postData.get("send_example")
     recv_example = postData.get("recv_example")  
           
     if operate == "insert":
         #新插入一天记录到数据库
         transformat.insertDB(trans_code,
             format_code,
             c_format ,
             send_example ,
             recv_example ,)  
         pass
     elif operate == "update" :
         #更新数据库
         transformat.updateDB(trans_code,
             format_code,
             c_format ,
             send_example ,
             recv_example ,)            
         pass
     elif operate == "delete":
         transformat.deleteDB(trans_code,)
     
     title, header, footer = getHeaderFooter("editformat")
     allformats = transformat.readEPTransForamt()
     return render.editformat(title, header, footer, None, None, None, allformats)
Beispiel #3
0
 def GET(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     title, header, footer = getHeaderFooter("about") 
     return render.about(title, header, footer)
 def GET(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     logging.info("client ip " + str(web.ctx.ip))
     title, header, footer = getHeaderFooter("generateXMLAndJavaCodePage")
     return render.generateXMLAndJavaCodePage(title, header, footer)
 def GET(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     title, header, footer = getHeaderFooter("editformat")
     allformats = transformat.readEPTransForamt()
     return render.editformat(title, header, footer, None, None, None, allformats)
    def POST(self, args):
        userlog.addLog(web.ctx.ip,
                       self.__class__.__name__ + " " + get_cur_fun_name(),
                       web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)

        postData = web.input()
        diff_dict, same_dict = compareTwoXml(postData.get("left_xml"), postData.get("right_xml"))
        title, header, footer = getHeaderFooter("xmlcompare")
        twoXml = {"left_xml":postData.get("left_xml"), "right_xml":postData.get("right_xml")}
        return render.xmlcompare(title, header, footer, diff_dict, same_dict, twoXml)
    def POST(self, args):
        postData = web.input();
        clearAllMemcache = postData.get("clearAllMemcache");
        invokeDubboFlag = postData.get("invokeDubbo");
        
        returnLog = ""
        if clearAllMemcache != None:
            userlog.addLog(web.ctx.ip, "clearMemcache", "all")
            
            #清理所有缓存
            returnLog = clearMemcache.clearAllMemcache()
            #返回清理缓存的日志
            return returnLog
        
        invokeResult = ""
        if invokeDubboFlag != None:
            host = postData.get("host");
            port = int(postData.get("port"));
            cmd = postData.get("cmd");
            advance = postData.get("advance");
            replaceStr = postData.get("replaceStr");
            argumentsValue = postData.get("argumentsValue");
            
            if advance == "true":
                cmds = []
                argumentsValue = eval(argumentsValue)
                for arguments in argumentsValue:
                    #替换所有的双引号为单引号,去掉开头和末尾的"[", "]"
                    arguments = str(arguments).replace('"', "'")[1:-1]
            
                    cmdFinal = cmd.replace(replaceStr, arguments)
                    #记录日志
                    userlog.addLog(web.ctx.ip, "invoke dubbo host:%s, port:%s" % (host, port), cmdFinal)          
                    cmds.append(cmdFinal)
                invokeResult = invokeDubboMultiCmd(host, port, cmds)
                pass
            else:
                userlog.addLog(web.ctx.ip, "invoke dubbo host:%s, port:%s" % (host, port), cmd)
                invokeResult = invokeDubbo(host, port, cmd)
                print "$%s$" % invokeResult
                pass
                        
            #返回invoke结果
            return invokeResult

        userlog.addLog(web.ctx.ip,
                       self.__class__.__name__ + " " + get_cur_fun_name(),
                       web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)        
        #正常的post  
        title, header, footer = getHeaderFooter("telnetDubboPage") 
        return render.telnetDubboPage(title, header, footer, returnLog, invokeResult) 
Beispiel #8
0
 def GET(self, args):
     title, header, footer = getHeaderFooter("userlog")
     #if login.isLogin():
     if True:
         addLog(web.ctx.ip,
                        self.__class__.__name__ + " " + get_cur_fun_name(),
                        web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
         
         alluserlog = readUserLog()
         userGroup = groupUserLog()
         telnetlog = readTelnetLastest()
         return render.userlogDB(title, header, footer, "logged", telnetlog, userGroup, alluserlog)
     else:
         return render.userlogDB(title, header, footer, None, None, None, None)
 def POST(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     postData = web.input()
     format, left, right = postData.get("format"), postData.get("left_string"), postData.get("right_string")
     
     resultList = stringCompare(format, left, right)
     title, header, footer = getHeaderFooter("stringcompare")
     twoString = {"left_string":left, "right_string":right}
     
     allformats = transformat.readEPTransForamt_stream()
     return render.stringcompare(title, header, footer, format, resultList, twoString, allformats)
    def POST(self, args):
        userlog.addLog(web.ctx.ip,
                       self.__class__.__name__ + " " + get_cur_fun_name(),
                       web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)

        postData = web.input()
        diff_dict, same_dict = compareTwoJson(postData.get("left_json"), postData.get("right_json"))
        title, header, footer = getHeaderFooter("jsoncompare")
        
        twojson = {"left_json":json.dumps(json.loads(postData.get("left_json")), indent=4), 
                   "right_json":json.dumps(json.loads(postData.get("right_json")), indent=4)}
        
        allformats = transformat.readEPTransForamt_json()
        return render.jsoncompare(title, header, footer, diff_dict, same_dict, twojson, allformats)
 def POST(self, args): 
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     postData = web.input()
     gen = Generate()
     
     zipFileName, filenameList = gen.gen(postData)
     
     zipFileName = zipFileName.replace("\\", "/")
     logging.info(zipFileName)
     print zipFileName
     
     title, header, footer = getHeaderFooter("generateXMLAndJavaCodePage")
     return render.generateXMLAndJavaCodePageResult(title, header, footer, zipFileName, filenameList)
    def GET(self, args):
        userlog.addLog(web.ctx.ip,
                       self.__class__.__name__ + " " + get_cur_fun_name(),
                       web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
        
        title, header, footer = getHeaderFooter("xmlcompare")
        twoXml = {
                  "left_xml":"""<ap>
    <pwd>left</pwd>
    <cardNo>6228480010007632</cardNo>
    <same>the same</same>
</ap>""",
                    "right_xml":"""<ap>
    <pwd>right</pwd>
    <cardNo></cardNo>
    <same>the same</same>
</ap> """}        
        return render.xmlcompare(title, header, footer, None, None, twoXml)
    def POST(self, args):
        postData = web.input();
        clearAllMemcacheFlag = postData.get("clearAllMemcache");
        
        returnLog = ""
        if clearAllMemcacheFlag != None:
            userlog.addLog(web.ctx.ip, "clearMemcache", "all")
            
            #清理所有缓存
            returnLog = clearAllMemcache()
            #返回清理缓存的日志
            return returnLog
        

        userlog.addLog(web.ctx.ip,
                       self.__class__.__name__ + " " + get_cur_fun_name(),
                       web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)        
        #正常的post  
        title, header, footer = getHeaderFooter("clearAllMemcachePage") 
        return render.clearAllMemcachePage(title, header, footer, returnLog, None) 
 def POST(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     x = web.input(myfile={})
     web.debug(x['myfile'].filename) # 这里是文件名
     gen = Generate()
     xmlDir, goalDir, dataDirName = gen.getXmlDirGoalDirDataDirName(x['myfile'].filename + ".")
     #上传的文件,写入到goalDir
     os.chdir(dataDirName)
     os.chdir(goalDir)
     print goalDir
     file(x['myfile'].filename, "w").write(x['myfile'].value)
     os.chdir("../..")
     zipFileName, filenameList = gen.genJavaCode(xmlDir, goalDir, dataDirName) 
     
     zipFileName = zipFileName.replace("\\", "/")
     title, header, footer = getHeaderFooter("upload")
     return render.uploadResult(title, header, footer, zipFileName, filenameList)
     pass
 def GET(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     title, header, footer = getHeaderFooter("stringcompare")
     format = """
 2 headLen
 3   firstField    
 4 nocomment
 5 
 6
     """
     left = "12345678901234"
     right = """12345678904321"""
     twoString = {"left_string":left, "right_string":right}
     
     resultList = None
     
     allformats = transformat.readEPTransForamt_stream()
             
     return render.stringcompare(title, header, footer, format, resultList, twoString, allformats)
 def GET(self, args):
     userlog.addLog(web.ctx.ip,
                    self.__class__.__name__ + " " + get_cur_fun_name(),
                    web.ctx.path + ":" + web.ctx.query + ":" + web.ctx.protocol)
     
     title, header, footer = getHeaderFooter("jsoncompare")
     twoJson = {
               "left_json":"""{
 "0":"123",
 "a":"",
 "b":1,
 "c":{
     "d":"e"
     }
 }""",
                 "right_json":""" {
 "a":"",
 "b":1,
 "c":{
     "d":"ef"
     }
 }"""}        
     allformats = transformat.readEPTransForamt_json()
     return render.jsoncompare(title, header, footer, None, None, twoJson, allformats)