当前位置: 首页>>代码示例>>Python>>正文


Python DebugLog.debug_print_level2方法代码示例

本文整理汇总了Python中utils.DebugLog.debug_print_level2方法的典型用法代码示例。如果您正苦于以下问题:Python DebugLog.debug_print_level2方法的具体用法?Python DebugLog.debug_print_level2怎么用?Python DebugLog.debug_print_level2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.DebugLog的用法示例。


在下文中一共展示了DebugLog.debug_print_level2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import debug_print_level2 [as 别名]
 def start(self):
     '''
     Start the commnucation ceneter 
     '''
     DebugLog.info_print("In VdCommCenter Start process")
     self.start = True
     while self.start:
         DebugLog.debug_print_level2("in while ... ")
         if self.delayed_snd_task.available():
             self._dispatchMsg(self.delayed_snd_task.getMsg(), VdCommCenter.CMD_SND)
             
         if not self.q_snd_task.empty():
             DebugLog.debug_print_level1("_dispatch snd queue message")
             self._dispatchMsg(self.q_snd_task.get(), VdCommCenter.CMD_SND)
         
         if not self.q_rcv_task.empty():
             DebugLog.debug_print_level1("_dispatch rcv queue message")
             self._dispatchMsg(self.q_rcv_task.get(), VdCommCenter.CMD_RCV)
             
         if self.q_rcv_task.empty() and self.q_snd_task.empty():
             time.sleep(1)
开发者ID:xhan-shannon,项目名称:SystemControlView,代码行数:23,代码来源:vdcommcnt.py

示例2: interactive_cmds

# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import debug_print_level2 [as 别名]
    def interactive_cmds(self, cmd, expect_prompt, with_return=False):
        '''execute the command, and return the output'''
        self.connectSSH()
        time.sleep(0.5)
        cmds = cmd.split(';')
        expect_prompts = expect_prompt.split()
        splitter_for_return =expect_prompts[0]

        DebugLog.debug_print_level2("in the interactive_cmd")
        DebugLog.debug_print_level2("send the commands %s" % cmds[0])

        # DebugLog.info_print("The current prompt is %s" % self.channel.)
        # self.channel.send(cmds[0]+"\n")
        expect_idx = 0
        buf = ''

        for indx in range(0, len(cmds)):
            # if indx != 0:
            DebugLog.info_print("Session cmd: %s" % cmds[indx])
            self.channel.send(cmds[indx] + "\n")
            time.sleep(1)
            buf = self.channel.recv(1920)
            
            expect_idx += 1

            while not buf.strip().endswith(expect_prompts[expect_idx]):
                buf += self.channel.recv(1920)
                time.sleep(1)
                DebugLog.info_print("Now the buf is : " + buf)


        if with_return:
            DebugLog.debug_print_level2("get the output")
            DebugLog.debug_print_level2(buf)

            # Got the content between two '~>'
            con_list = buf.split(splitter_for_return)
            con = con_list[-2]

            splitter = '\r\n'
            if splitter in con:
                pass
            else:
                splitter = '\n'
            buf_out = con.split(splitter)
            buf_out = buf_out[1:-1]
            return buf_out
开发者ID:xhan-shannon,项目名称:SystemControlView,代码行数:49,代码来源:remote_session.py

示例3: clean_know_hosts

# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import debug_print_level2 [as 别名]
    if os.path.isfile(known_hosts_file):
        os.system("echo '' > %s" % known_hosts_file)


if __name__ == '__main__':

    
    try:
        # Test exception throw
        #raise Exception, "Test exception catchup ... "
        
        clean_know_hosts()
        
        vd_config = ConfigParser.ConfigParser()
        vd_config_fname = 'vd.cfg'
        DebugLog.debug_print_level2("The config_file is " + vd_config_fname)
        
        if vd_config and os.path.exists(vd_config_fname):
            vd_config.read(vd_config_fname)
        else:
            raise ConfigFileError('%s not found' % (vd_config_fname))
        
        vdCommCenterThrd = Thread(target=vdCommCenter_inst.start)
        vdCommCenterThrd.start()
        
        server_data_entity = DataEntity(vd_config) 
        
        vd_contr = SvrController(vd_config, vdCommCenter_inst, server_data_entity)
            
        
        root = Tk()
开发者ID:xhan-shannon,项目名称:SystemControlView,代码行数:33,代码来源:vdt.py


注:本文中的utils.DebugLog.debug_print_level2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。