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


Python rg_logger.info函数代码示例

本文整理汇总了Python中utls.rg_io.rg_logger.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: runcmd

    def runcmd(self,rargs,fun,extra=None) :
        import utls.rg_yaml,copy
        utls.check.must_exists(rargs.prj.conf)
        rg_logger.info("load prj conf: %s" %(rargs.prj.conf))
        loader = utls.rg_yaml.conf_loader(rargs.prj.conf)
        data   = loader.load_data("!R","res")
        prj_cmd_base.check_data(data)

        env_data    = data['_env']
        sys_data    = data['_sys']

        if data.has_key('_mod') :
            for m  in  data['_mod'] :
                res.node.regist_mod(m)


        main  = res.prj_main()
        if len(self.env) == 0 :
            return
        #import pdb
        #pdb.set_trace()
        

        for env_obj  in env_data  :
            res.node.env_regist(env_obj)
            if self.env == "@all" :
                main.append(env_obj)

        if self.env != "@all"  :
            for  need_env in self.env :
                obj = res.node.env_find(need_env)
                if obj is not None :
                    main.append(obj)
                else:
                    raise interface.rigger_exception("env [%s] not found" %(need_env))


        for sys_obj in   sys_data  :
            res.node.sys_regist(sys_obj)
            if self.sys == "@all":
                main.append(sys_obj)

        if len(self.sys) > 1 and extra is not None :
                raise interface.rigger_exception("extra obj will execute in muti sys" %(len(self.sys)))

        if self.sys != "@all"  :
            for need_sys in self.sys :
                obj = res.node.sys_find(need_sys)
                if obj is not None :
                    if extra is not None :
                        obj.append(extra)
                    main.append(obj)
                else :
                    raise interface.rigger_exception("sys [%s] not found" %(need_sys))

        context = interface.run_context()
        project = res.project()
        project.setup4start(context)
        interface.control_call(main,fun,context,"unknow")
开发者ID:jqlblue,项目名称:rigger-ng,代码行数:59,代码来源:rg_cmd_prj.py

示例2: parse_cmd

 def parse_cmd(self):
     if len(self.cmds) == 0 :
         raise badargs_exception("没有命令")
     if len(self.cmds) > 1:
         self.subcmd = self.cmds[1:]
         rg_logger.info("subcmd: %s" %self.subcmd)
     cmdarr = self.cmds[0].split(',')
     return cmdarr
开发者ID:sunxiaojun2014,项目名称:rigger-ng,代码行数:8,代码来源:rg_args.py

示例3: _before

 def _before(self,context):
     rg_logger.info("env:%s _before" %(self._name))
     if self._mix is not None :
         for key in  self._mix.split(",") :
             obj = res.node.env_find(key)
             if obj is None :
                 raise interface.rigger_exception("env [%s] : mix [%s] not found " %(self._name,key))
             self.append(obj)
开发者ID:wangzengzhi,项目名称:rigger-ng,代码行数:8,代码来源:inner.py

示例4: loadconf

 def loadconf(self,rargs) :
     # import  pdb
     # pdb.set_trace()
     import utls.rg_yaml,copy
     utls.dbc.must_exists(rargs.dev.conf)
     rg_logger.info("load prj conf: %s" %(rargs.dev.conf))
     loader   = utls.rg_yaml.conf_loader(rargs.dev.conf)
     data     = loader.load_data("!C","conf")
     dev_data = data['_dev']
     for confobj in dev_data :
         confobj._load()
开发者ID:sunxiaojun2014,项目名称:rigger-ng,代码行数:11,代码来源:rg_cmd_dev.py

示例5: run_rigger

def run_rigger(rargs, argv) :
    #TODO: muti cmd support
    if len(rargs.prj.cmds) == 0 :
        raise interface.rigger_exception("No Cmd!")
    cmds = rargs.prj.cmds[0]
    for  cmd in cmds.split(',') :
        obj = rg_ioc.ins_cmd(cmd)
        if obj is None :
            raise  interface.rigger_exception( "unfound '%s' cmd instance" %cmd)
        rg_logger.info("cmd: %s , cmd_ins : %s" %(cmd,obj.__class__.__name__))
        obj._config(argv,rargs)
        obj._execute(rargs)
开发者ID:sunxiaojun2014,项目名称:rigger-ng,代码行数:12,代码来源:rg_run.py

示例6: _before

 def _before(self,context):
     context.use_env(self._name)
     rg_logger.info("env:%s _before" %(self._name))
     mix_obj = []
     if self._mix is not None :
         for key in  self._mix.split(",") :
             obj =  interface.res_proxy(res.node.env_find,key,"env")
             mix_obj.append(obj)
             # obj = res.node.env_find(key)
             # if obj is None :
             #     raise interface.rigger_exception("env [%s] : mix [%s] not found " %(self._name,key))
             # self.append(obj)
     self.extend_left(mix_obj)
开发者ID:dzhcool,项目名称:rigger-ng,代码行数:13,代码来源:inner.py

示例7: file

    def file(self,tplfile,dstfile):
        tpl      = open(tplfile, 'r')
        isstdout = dstfile == sys.stdout
        dst      = dstfile if isstdout else open(dstfile, 'w')
        st       = tplstatus.NONE

        block   = []
        cond    = ""
        expect  = None
        for line in tpl:
            if st == tplstatus.BLOCK_IN:
                if self.re_block_end.match(line) :
                    st=tplstatus.NONE
                    code = "cond_val = %s"  %cond
                    code = code.replace("T.","self.tpl_vars.")
                    exec  code
                    rg_logger.debug(" code in block '%s'[%s]" %(cond,str(cond_val)) )
                    if str(cond_val).upper() == expect.upper() :
                        xblock = []
                        for line in block :
                            rg_logger.debug("proc line: %s" %(line) )
                            xblock.append(self.value(line))
                        dst.writelines(xblock)
                    block = []
                else:
                    block.append(line)
                continue
            if st == tplstatus.NONE:
                code_match  = self.re_code.match(line)
                block_match = self.re_block_beg.match(line)
                if  block_match:
                    st=tplstatus.BLOCK_IN
                    cond    = block_match.group(1).strip()
                    expect  = block_match.group(2).strip()
                    if len(expect) == 0 :
                        expect = "TRUE"
                    pass
                elif code_match :
                    code = code_match.group(1).strip()
                    code = code.replace("T.","self.tpl_vars")
                    rg_logger.info(code)
                    exec code
                else:
                    line = self.value(line)
                    dst.write(line)
        tpl.close()
        dst.close()
        if not isstdout:
            stat =  os.stat(tplfile)
            os.chmod(dstfile,stat.st_mode)
开发者ID:sunxiaojun2014,项目名称:rigger-ng,代码行数:50,代码来源:tpl_engine.py

示例8: _before

    def _before(self,context):
        rg_logger.info("system:%s _before " %(self._name))
        utls.rg_var.keep()
        context.keep()

        #support run_path var
        auto_vars = vars()
        auto_vars.SYS_NAME = self._name
        auto_vars.RUN_PATH = "%s/run/%s" %(context.prj.root,self._name)

        run_path     = res.files.path()
        run_path.dst = auto_vars.RUN_PATH

        self.push(run_path)
        self.push(auto_vars)
开发者ID:ayibang-openlab,项目名称:rigger-ng,代码行数:15,代码来源:inner.py

示例9: proc_files

    def proc_files(self,arg,dirname,names):
        src_path    = dirname
        relat_path  = src_path.replace(self.src,'').lstrip('/')
        dst_path    = os.path.join(self.dst   , relat_path)
        dst_path    = self.ng.convert_path(dst_path)
        if dst_path is None :
            return

        rg_logger.info("proc file : src[ %s ]  --> dst [%s]" %(src_path,dst_path) )
        if not os.path.exists(dst_path):
            os.makedirs(dst_path)
        for n in names:
            src = os.path.join(src_path ,n)
            dst = self.ng.value(os.path.join(dst_path ,n))
            if n != "_tpl.yaml"  and not os.path.isdir(src):
                rg_logger.info( "proc tpl file: %s -> %s" %(src,dst) )
                self.ng.file( src  , dst )
开发者ID:sunxiaojun2014,项目名称:rigger-ng,代码行数:17,代码来源:tpl_engine.py

示例10: load

def load(conf_yaml) :
    import utls.rg_yaml,copy
    rg_logger.info("load prj conf: %s" %(conf_yaml))
    loader = utls.rg_yaml.conf_loader(conf_yaml)
    data   = loader.load_data("!R","res")
    # print("-------------%s----------" %(conf_yaml))
    check_data(data)


    if data.has_key('_mod') :
        for m  in  data['_mod'] :
            res.node.module_regist(m)

    if data.has_key('_env') :
        for obj  in data['_env']:
            res.node.env_regist(obj)

    if data.has_key('_sys') :
        for obj  in data['_sys']:
            res.node.sys_regist(obj)
开发者ID:dzhcool,项目名称:rigger-ng,代码行数:20,代码来源:run_conf.py

示例11: runcmd

    def runcmd(self,rargs,fun) :
        import utls.rg_yaml,copy
        utls.dbc.must_exists(rargs.prj.conf)
        rg_logger.info("load prj conf: %s" %(rargs.prj.conf))
        loader = utls.rg_yaml.conf_loader(rargs.prj.conf)
        data   = loader.load_data("!R","res")
        prj_cmd_base.check_data(data)

        env_data    = data['_env']
        sys_data    = data['_sys']

        if data.has_key('_mod') :
            for m  in  data['_mod'] :
                res.node.regist_mod(m)


        main  = res.prj_main()
        if len(self.env) == 0 :
            return
        #import pdb
        #pdb.set_trace()
        for env in self.env :
            for env_obj  in env_data :
                res.node.env_regist(env_obj)
                if env_obj._name == env :
                    main.append(env_obj)
        context = interface.run_context()
        # interface.control_call(main,fun,context)

        if len(self.sys) > 0 :
            for sys in self.sys :
                for sysobj in   sys_data :
                    res.node.sys_regist(sysobj)
                    if  sysobj._name ==  sys :
                        main.append(sysobj)
                    # interface.control_call(sysobj,fun,context)

        interface.control_call(main,fun,context,"unknow")
开发者ID:ayibang-openlab,项目名称:rigger-ng,代码行数:38,代码来源:rg_cmd_prj.py

示例12: _after

 def _after(self,context):
     rg_logger.info("env:%s _after " %(self._name))
开发者ID:ayibang-openlab,项目名称:rigger-ng,代码行数:2,代码来源:inner.py

示例13: load_args

 def load_args(self,saved ) :
     if hasattr(saved,'vars_def') and saved.vars_def is not None:
         if not self.argv.has_key('-v') :
             self.argv['-v'] = saved.vars_def
         else:
             rg_logger.info ( "old prior vars ignore:  %s " % rargs.vars_def)
开发者ID:sunxiaojun2014,项目名称:rigger-ng,代码行数:6,代码来源:rg_args.py


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