當前位置: 首頁>>代碼示例>>Python>>正文


Python Logs.verbose方法代碼示例

本文整理匯總了Python中waflib.Logs.verbose方法的典型用法代碼示例。如果您正苦於以下問題:Python Logs.verbose方法的具體用法?Python Logs.verbose怎麽用?Python Logs.verbose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在waflib.Logs的用法示例。


在下文中一共展示了Logs.verbose方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def test(self,*k,**kw):
    if not'env'in kw:
        kw['env']=self.env.derive()
    if kw.get('validate',None):
        kw['validate'](kw)
    self.start_msg(kw['msg'],**kw)
    ret=None
    try:
        ret=self.run_build(*k,**kw)
    except self.errors.ConfigurationError:
        self.end_msg(kw['errmsg'],'YELLOW',**kw)
        if Logs.verbose>1:
            raise
        else:
            self.fatal('The configuration failed')
    else:
        kw['success']=ret
    if kw.get('post_check',None):
        ret=kw['post_check'](kw)
    if ret:
        self.end_msg(kw['errmsg'],'YELLOW',**kw)
        self.fatal('The configuration failed %r'%ret)
    else:
        self.end_msg(self.ret_msg(kw['okmsg'],kw),**kw)
    return ret 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:27,代碼來源:Configure.py

示例2: check_cfg

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def check_cfg(self,*k,**kw):
    if k:
        lst=k[0].split()
        kw['package']=lst[0]
        kw['args']=' '.join(lst[1:])
    self.validate_cfg(kw)
    if'msg'in kw:
        self.start_msg(kw['msg'],**kw)
    ret=None
    try:
        ret=self.exec_cfg(kw)
    except self.errors.WafError:
        if'errmsg'in kw:
            self.end_msg(kw['errmsg'],'YELLOW',**kw)
        if Logs.verbose>1:
            raise
        else:
            self.fatal('The configuration failed')
    else:
        if not ret:
            ret=True
        kw['success']=ret
        if'okmsg'in kw:
            self.end_msg(self.ret_msg(kw['okmsg'],kw),**kw)
    return ret 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:27,代碼來源:c_config.py

示例3: check

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def check(self,*k,**kw):
    self.validate_c(kw)
    self.start_msg(kw['msg'],**kw)
    ret=None
    try:
        ret=self.run_build(*k,**kw)
    except self.errors.ConfigurationError:
        self.end_msg(kw['errmsg'],'YELLOW',**kw)
        if Logs.verbose>1:
            raise
        else:
            self.fatal('The configuration failed')
    else:
        kw['success']=ret
    ret=self.post_check(*k,**kw)
    if not ret:
        self.end_msg(kw['errmsg'],'YELLOW',**kw)
        self.fatal('The configuration failed %r'%ret)
    else:
        self.end_msg(self.ret_msg(kw['okmsg'],kw),**kw)
    return ret 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:23,代碼來源:c_config.py

示例4: parse_options

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def parse_options():
    Context.create_context('options').execute()
    for var in Options.envvars:
        (name,value)=var.split('=',1)
        os.environ[name.strip()]=value
    if not Options.commands:
        Options.commands=[default_cmd]
    Options.commands=[x for x in Options.commands if x!='options']
    Logs.verbose=Options.options.verbose
    if Options.options.zones:
        Logs.zones=Options.options.zones.split(',')
        if not Logs.verbose:
            Logs.verbose=1
    elif Logs.verbose>0:
        Logs.zones=['runner']
    if Logs.verbose>2:
        Logs.zones=['*'] 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:19,代碼來源:Scripting.py

示例5: exec_command

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def exec_command(self,cmd,**kw):
        subprocess=Utils.subprocess
        kw['shell']=isinstance(cmd,str)
        Logs.debug('runner: %r'%(cmd,))
        Logs.debug('runner_env: kw=%s'%kw)
        if self.logger:
            self.logger.info(cmd)
        if'stdout'not in kw:
            kw['stdout']=subprocess.PIPE
        if'stderr'not in kw:
            kw['stderr']=subprocess.PIPE
        if Logs.verbose and not kw['shell']and not Utils.check_exe(cmd[0]):
            raise Errors.WafError("Program %s not found!"%cmd[0])
        try:
            if kw['stdout']or kw['stderr']:
                p=subprocess.Popen(cmd,**kw)
                (out,err)=p.communicate()
                ret=p.returncode
            else:
                out,err=(None,None)
                ret=subprocess.Popen(cmd,**kw).wait()
        except Exception ,e:
            raise Errors.WafError('Execution failure: %s'%str(e),ex=e) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:25,代碼來源:Context.py

示例6: cmd_and_log

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def cmd_and_log(self,cmd,**kw):
        subprocess=Utils.subprocess
        kw['shell']=isinstance(cmd,str)
        Logs.debug('runner: %r'%(cmd,))
        if'quiet'in kw:
            quiet=kw['quiet']
            del kw['quiet']
        else:
            quiet=None
        if'output'in kw:
            to_ret=kw['output']
            del kw['output']
        else:
            to_ret=STDOUT
        if Logs.verbose and not kw['shell']and not Utils.check_exe(cmd[0]):
            raise Errors.WafError("Program %s not found!"%cmd[0])
        kw['stdout']=kw['stderr']=subprocess.PIPE
        if quiet is None:
            self.to_log(cmd)
        try:
            p=subprocess.Popen(cmd,**kw)
            (out,err)=p.communicate()
        except Exception ,e:
            raise Errors.WafError('Execution failure: %s'%str(e),ex=e) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:26,代碼來源:Context.py

示例7: post

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def post(self):
        buf=[]
        for x in self.source:
            if isinstance(x,waflib.Node.Node):
                y=x
            else:
                y=self.path.find_resource(x)
                if not y:
                    if Logs.verbose:
                        Logs.warn('Could not find %s immediately (may cause broken builds)'%x)
                    idx=self.generator.bld.get_group_idx(self)
                    for tg in self.generator.bld.groups[idx]:
                        if not isinstance(tg,inst)and id(tg)!=id(self):
                            tg.post()
                        y=self.path.find_resource(x)
                        if y:
                            break
                    else:
                        raise Errors.WafError('Could not find %r in %r'%(x,self.path))
            buf.append(y)
        self.inputs=buf 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:23,代碼來源:Build.py

示例8: post

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def post(self):
    self.features=self.to_list(self.features)
    if'cc'in self.features:
        if Logs.verbose:
            Logs.warn('compat: the feature cc does not exist anymore (use "c")')
        self.features.remove('cc')
        self.features.append('c')
    if'cstaticlib'in self.features:
        if Logs.verbose:
            Logs.warn('compat: the feature cstaticlib does not exist anymore (use "cstlib" or "cxxstlib")')
        self.features.remove('cstaticlib')
        self.features.append(('cxx'in self.features)and'cxxstlib'or'cstlib')
    if getattr(self,'ccflags',None):
        if Logs.verbose:
            Logs.warn('compat: "ccflags" was renamed to "cflags"')
        self.cflags=self.ccflags
    return old_post(self) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:19,代碼來源:compat15.py

示例9: load_module

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def load_module(path,encoding=None):
    ret=rev(path,encoding)
    if'set_options'in ret.__dict__:
        if Logs.verbose:
            Logs.warn('compat: rename "set_options" to "options" (%r)'%path)
        ret.options=ret.set_options
    if'srcdir'in ret.__dict__:
        if Logs.verbose:
            Logs.warn('compat: rename "srcdir" to "top" (%r)'%path)
        ret.top=ret.srcdir
    if'blddir'in ret.__dict__:
        if Logs.verbose:
            Logs.warn('compat: rename "blddir" to "out" (%r)'%path)
        ret.out=ret.blddir
    Utils.g_module=Context.g_module
    Options.launch_dir=Context.launch_dir
    return ret 
開發者ID:KTH,項目名稱:royal-chaos,代碼行數:19,代碼來源:compat15.py

示例10: run

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def run(self):
                argparser = fypp.get_option_parser()
                args = [FYPP_LINENUM_FLAG]
                args += self.env.FYPP_FLAGS
        args += [FYPP_DEFINES_ST % ss for ss in self.env['DEFINES']]
        args += [FYPP_INCPATH_ST % ss for ss in self.env['INCLUDES']]
                args += [FYPP_INIFILES_ST % ss for ss in self.env['INIFILES']]
                args += [FYPP_MODULES_ST % ss for ss in self.env['MODULES']]
                opts, leftover = argparser.parse_args(args)
                infile = self.inputs[0].abspath()
                outfile = self.outputs[0].abspath()
                if Logs.verbose:
                        Logs.debug('runner: fypp.Fypp %r %r %r' 
                                   % (args, infile, outfile))
                
        tool = fypp.Fypp(opts)
                try:
                tool.process_file(infile, outfile)
                except fypp.FyppError as err:
                        msg = ("%s [%s:%d]"
                               % (err.msg, err.fname, err.span[0] + 1))
                        raise FyppPreprocError(msg)
        return 0 
開發者ID:aradi,項目名稱:fypp,代碼行數:25,代碼來源:fypp_preprocessor.py

示例11: sig_implicit_deps

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def sig_implicit_deps(self):
        bld=self.generator.bld
        key=self.uid()
        prev=bld.task_sigs.get((key,'imp'),[])
        if prev:
            try:
                if prev==self.compute_sig_implicit_deps():
                    return prev
            except Errors.TaskNotReady:
                raise
            except EnvironmentError:
                for x in bld.node_deps.get(self.uid(),[]):
                    if not x.is_bld():
                        try:
                            os.stat(x.abspath())
                        except OSError:
                            try:
                                del x.parent.children[x.name]
                            except KeyError:
                                pass
            del bld.task_sigs[(key,'imp')]
            raise Errors.TaskRescan('rescan')
        (nodes,names)=self.scan()
        if Logs.verbose:
            Logs.debug('deps: scanner for %s returned %s %s'%(str(self),str(nodes),str(names)))
        bld.node_deps[key]=nodes
        bld.raw_deps[key]=names
        self.are_implicit_nodes_ready()
        try:
            bld.task_sigs[(key,'imp')]=sig=self.compute_sig_implicit_deps()
        except Exception:
            if Logs.verbose:
                for k in bld.node_deps.get(self.uid(),[]):
                    try:
                        k.get_bld_sig()
                    except Exception:
                        Logs.warn('Missing signature for node %r (may cause rebuilds)'%k)
        else:
            return sig 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:41,代碼來源:Task.py

示例12: run

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def run(self):
        env=self.env
        gen=self.generator
        bld=gen.bld
        wd=bld.bldnode.abspath()
        def to_list(xx):
            if isinstance(xx,str):return[xx]
            return xx
        cmd=[]
        cmd.extend(to_list(env['JAVAC']))
        cmd.extend(['-classpath'])
        cmd.extend(to_list(env['CLASSPATH']))
        cmd.extend(['-d'])
        cmd.extend(to_list(env['OUTDIR']))
        cmd.extend(to_list(env['JAVACFLAGS']))
        files=[a.path_from(bld.bldnode)for a in self.inputs]
        tmp=None
        try:
            if len(str(files))+len(str(cmd))>8192:
                (fd,tmp)=tempfile.mkstemp(dir=bld.bldnode.abspath())
                try:
                    os.write(fd,'\n'.join(files))
                finally:
                    if tmp:
                        os.close(fd)
                if Logs.verbose:
                    Logs.debug('runner: %r'%(cmd+files))
                cmd.append('@'+tmp)
            else:
                cmd+=files
            ret=self.exec_command(cmd,cwd=wd,env=env.env or None)
        finally:
            if tmp:
                os.remove(tmp)
        return ret 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:37,代碼來源:javaw.py

示例13: addlines

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def addlines(self,node):
        self.currentnode_stack.append(node.parent)
        filepath=node.abspath()
        self.count_files+=1
        if self.count_files>c_preproc.recursion_limit:
            raise c_preproc.PreprocError("recursion limit exceeded")
        pc=self.parse_cache
        Logs.debug('preproc: reading file %r',filepath)
        try:
            lns=pc[filepath]
        except KeyError:
            pass
        else:
            self.lines.extend(lns)
            return
        try:
            lines=self.filter_comments(filepath)
            lines.append((c_preproc.POPFILE,''))
            lines.reverse()
            pc[filepath]=lines
            self.lines.extend(lines)
        except IOError:
            raise c_preproc.PreprocError("could not read the file %s"%filepath)
        except Exception:
            if Logs.verbose>0:
                Logs.error("parsing %s failed"%filepath)
                traceback.print_exc() 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:29,代碼來源:winres.py

示例14: scan

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def scan(self):
        tmp=rc_parser(self.generator.includes_nodes)
        tmp.start(self.inputs[0],self.env)
        nodes=tmp.nodes
        names=tmp.names
        if Logs.verbose:
            Logs.debug('deps: deps for %s: %r; unresolved %r'%(str(self),nodes,names))
        return(nodes,names) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:10,代碼來源:winres.py

示例15: scan

# 需要導入模塊: from waflib import Logs [as 別名]
# 或者: from waflib.Logs import verbose [as 別名]
def scan(self):
        tmp=fc_scan.fortran_parser(self.generator.includes_nodes)
        tmp.task=self
        tmp.start(self.inputs[0])
        if Logs.verbose:
            Logs.debug('deps: deps for %r: %r; unresolved %r'%(self.inputs,tmp.nodes,tmp.names))
        return(tmp.nodes,tmp.names) 
開發者ID:MOSAIC-UA,項目名稱:802.11ah-ns3,代碼行數:9,代碼來源:fc.py


注:本文中的waflib.Logs.verbose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。