示例#1
0
 def run(self):
     WBXTFBusiness.setRoot(self._interfaceObj)
     oTool = WBXTFBusiness.registerAsTool(self._interfaceName, dependThreadName=self._dependThreadName)
     if oTool.IsRegister() == True:
         URL = "wbxtf://%s/tool.$%s" % (self._machineIp,str(oTool.m_handle))
         self._interfaceObj.WBXTFSetToolURL(URL)
     WBXTFBusiness.runningRegisterTool(oTool)
示例#2
0
    def __LoadModule(self, sModuleName, sPath, sShortModuleName):
        try:
            if self.__IsLoad(sModuleName):
                exec('reload(%s)' % (sModuleName))
                return True

            res = imp.find_module(sShortModuleName, [sPath])
            tmp = imp.load_module(sShortModuleName, res[0], res[1], res[2])
            WBXTFBusiness.supportModule(tmp)
            if "." in sModuleName:
                exec("%s = tmp" % (sModuleName))
            else:
                exec("global %s;%s = tmp" % (sModuleName, sModuleName))

            self.m_modules[sModuleName] = True
            return True
        except ImportError, e:
            return False
示例#3
0
 def Load(self):
     # Clear all
     self.__clearModule()
     res = self.__LoadDir(self.m_sPath)
     WBXTFBusiness.setRoot(globals())
     return res
示例#4
0
def exit():
    WBXTFBusiness.clearHiddenObject()
    WBXTFBusiness.cancelAsTool()
示例#5
0
__gLoader = WBBusinessLoader()

#def SetPath(sPath):
#    return __gLoader.SetPath(sPath)


def setPath(sPath):
    return __gLoader.SetPath(sPath)


def load():
    return __gLoader.Load()


def setTimeout(timeout):
    WBXTFBusiness.WB_INFINIT = timeout


def getTimeout():
    return WBXTFBusiness.WB_INFINIT


def exit():
    WBXTFBusiness.clearHiddenObject()
    WBXTFBusiness.cancelAsTool()


WBXTFBusiness.hideObject(setPath)
WBXTFBusiness.hideObject(load)
WBXTFBusiness.hideObject(wbxtf_init_modules)
示例#6
0
 def unregisterTool(self):
     WBXTFBusiness.cancelAsTool()
示例#7
0
                    
                    iostatLines = statBlock.split("\n")
                    
                    keyLine = iostatLines[0].replace(":","").replace("%","").replace("/s","")
                    iostatKeys = keyLine.split()
                    lineIndex =1
                    while lineIndex <len(iostatLines):
                        valueLine = iostatLines[lineIndex]
                        values = valueLine.split()
                        if(len(iostatKeys)==len(values)):
                            iostatInfo = {}
                            keyIndex =0
                            while(keyIndex<len(iostatKeys)):
                                iostatInfo[iostatKeys[keyIndex]]=values[keyIndex]
                                keyIndex +=1
                            iostatInfos.append(iostatInfo)
                        lineIndex +=1
        except Exception,e:
            print "parse iostat info exception :%s"%e
        return iostatInfos
    
    def getIOStatInfo(self):
        ress = self.__getIOIStatOInfo()
        return self.__parseIOStatInfo(ress)

sysinfo = SysInfo()

WBXTFBusiness.setRoot(globals())
WBXTFBusiness.runAsTool("sysinfo")
#ress= sysinfo.getTopInfo()