• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python Logs.error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: install_pyfile

def install_pyfile(self,node,install_from=None):
	from_node=install_from or node.parent
	tsk=self.bld.install_as(self.install_path+'/'+node.path_from(from_node),node,postpone=False)
	path=tsk.get_install_path()
	if self.bld.is_install<0:
		info("+ removing byte compiled python files")
		for x in'co':
			try:
				os.remove(path+x)
			except OSError:
				pass
	if self.bld.is_install>0:
		try:
			st1=os.stat(path)
		except:
			error('The python file is missing, this should not happen')
		for x in['c','o']:
			do_inst=self.env['PY'+x.upper()]
			try:
				st2=os.stat(path+x)
			except OSError:
				pass
			else:
				if st1.st_mtime<=st2.st_mtime:
					do_inst=False
			if do_inst:
				lst=(x=='o')and[self.env['PYFLAGS_OPT']]or[]
				(a,b,c)=(path,path+x,tsk.get_install_path(destdir=False)+x)
				argv=self.env['PYTHON']+lst+['-c',INST,a,b,c]
				info('+ byte compiling %r'%(path+x))
				env=self.env.env or None
				ret=Utils.subprocess.Popen(argv,env=env).wait()
				if ret:
					raise Errors.WafError('py%s compilation failed %r'%(x,path))
开发者ID:ETLin,项目名称:ns3-h264-svc,代码行数:34,代码来源:python.py


示例2: install_pyfile

def install_pyfile(self, node, install_from=None):
    from_node = install_from or node.parent
    tsk = self.bld.install_as(self.install_path + "/" + node.path_from(from_node), node, postpone=False)
    path = tsk.get_install_path()
    if self.bld.is_install < 0:
        info("+ removing byte compiled python files")
        for x in "co":
            try:
                os.remove(path + x)
            except OSError:
                pass
    if self.bld.is_install > 0:
        try:
            st1 = os.stat(path)
        except:
            error("The python file is missing, this should not happen")
        for x in ["c", "o"]:
            do_inst = self.env["PY" + x.upper()]
            try:
                st2 = os.stat(path + x)
            except OSError:
                pass
            else:
                if st1.st_mtime <= st2.st_mtime:
                    do_inst = False
            if do_inst:
                lst = (x == "o") and [self.env["PYFLAGS_OPT"]] or []
                (a, b, c) = (path, path + x, tsk.get_install_path(destdir=False) + x)
                argv = self.env["PYTHON"] + lst + ["-c", INST, a, b, c]
                info("+ byte compiling %r" % (path + x))
                ret = Utils.subprocess.Popen(argv).wait()
                if ret:
                    raise Errors.WafError("py%s compilation failed %r" % (x, path))
开发者ID:janbre,项目名称:NUTS,代码行数:33,代码来源:python.py


示例3: apply_intltool_in_f

def apply_intltool_in_f(self):
	try:self.meths.remove('process_source')
	except ValueError:pass
	self.ensure_localedir()
	podir=getattr(self,'podir','.')
	podirnode=self.path.find_dir(podir)
	if not podirnode:
		error("could not find the podir %r"%podir)
		return
	cache=getattr(self,'intlcache','.intlcache')
	self.env.INTLCACHE=[os.path.join(str(self.path.get_bld()),podir,cache)]
	self.env.INTLPODIR=podirnode.bldpath()
	self.env.append_value('INTLFLAGS',getattr(self,'flags',self.env.INTLFLAGS_DEFAULT))
	if'-c'in self.env.INTLFLAGS:
		self.bld.fatal('Redundant -c flag in intltool task %r'%self)
	style=getattr(self,'style',None)
	if style:
		try:
			style_flag=_style_flags[style]
		except KeyError:
			self.bld.fatal('intltool_in style "%s" is not valid'%style)
		self.env.append_unique('INTLFLAGS',[style_flag])
	for i in self.to_list(self.source):
		node=self.path.find_resource(i)
		task=self.create_task('intltool',node,node.change_ext(''))
		inst=getattr(self,'install_path',None)
		if inst:
			self.bld.install_files(inst,task.outputs)
开发者ID:AliZafar120,项目名称:ns3,代码行数:28,代码来源:intltool.py


示例4: iapply_intltool_in_f

def iapply_intltool_in_f(self):
	try: self.meths.remove('process_source')
	except ValueError: pass

	if not self.env.LOCALEDIR:
		self.env.LOCALEDIR = self.env.PREFIX + '/share/locale'

	for i in self.to_list(self.source):
		node = self.path.find_resource(i)

		podir = getattr(self, 'podir', 'po')
		podirnode = self.path.find_dir(podir)
		if not podirnode:
			error("could not find the podir %r" % podir)
			continue

		cache = getattr(self, 'intlcache', '.intlcache')
		self.env['INTLCACHE'] = os.path.join(self.path.bldpath(), podir, cache)
		self.env['INTLPODIR'] = podirnode.bldpath()
		self.env['INTLFLAGS'] = getattr(self, 'flags', ['-q', '-u', '-c'])

		task = self.create_task('intltool', node, node.change_ext(''))
		inst = getattr(self, 'install_path', '${LOCALEDIR}')
		if inst:
			self.bld.install_files(inst, task.outputs)
开发者ID:SjB,项目名称:waf,代码行数:25,代码来源:intltool.py


示例5: addlines

	def addlines(self,node):
		self.currentnode_stack.append(node.parent)
		filepath=node.abspath()
		self.count_files+=1
		if self.count_files>recursion_limit:
			raise PreprocError("recursion limit exceeded")
		pc=self.parse_cache
		debug('preproc: reading file %r',filepath)
		try:
			lns=pc[filepath]
		except KeyError:
			pass
		else:
			self.lines.extend(lns)
			return
		try:
			lines=filter_comments(filepath)
			lines.append((POPFILE,''))
			lines.reverse()
			pc[filepath]=lines
			self.lines.extend(lines)
		except IOError:
			raise PreprocError("could not read the file %s"%filepath)
		except Exception:
			if Logs.verbose>0:
				error("parsing %s failed"%filepath)
				traceback.print_exc()
开发者ID:AliZafar120,项目名称:ns3,代码行数:27,代码来源:c_preproc.py


示例6: add_moc_tasks

	def add_moc_tasks(self):
		node=self.inputs[0]
		bld=self.generator.bld
		try:
			self.signature()
		except KeyError:
			pass
		else:
			delattr(self,'cache_sig')
		moctasks=[]
		mocfiles=[]
		try:
			tmp_lst=bld.raw_deps[self.uid()]
			bld.raw_deps[self.uid()]=[]
		except KeyError:
			tmp_lst=[]
		for d in tmp_lst:
			if not d.endswith('.moc'):
				continue
			if d in mocfiles:
				error("paranoia owns")
				continue
			mocfiles.append(d)
			ext=''
			try:ext=Options.options.qt_header_ext
			except AttributeError:pass
			if not ext:
				base2=d[:-4]
				for exth in MOC_H:
					k=node.parent.find_node(base2+exth)
					if k:
						break
				else:
					raise Errors.WafError('no header found for %r which is a moc file'%d)
			h_node=node.parent.find_resource(base2+exth)
			m_node=h_node.change_ext('.moc')
			bld.node_deps[(self.inputs[0].parent.abspath(),m_node.name)]=h_node
			task=Task.classes['moc'](env=self.env,generator=self.generator)
			task.set_inputs(h_node)
			task.set_outputs(m_node)
			gen=bld.producer
			gen.outstanding.insert(0,task)
			gen.total+=1
			moctasks.append(task)
		tmp_lst=bld.raw_deps[self.uid()]=mocfiles
		lst=bld.node_deps.get(self.uid(),())
		for d in lst:
			name=d.name
			if name.endswith('.moc'):
				task=Task.classes['moc'](env=self.env,generator=self.generator)
				task.set_inputs(bld.node_deps[(self.inputs[0].parent.abspath(),name)])
				task.set_outputs(d)
				gen=bld.producer
				gen.outstanding.insert(0,task)
				gen.total+=1
				moctasks.append(task)
		self.run_after.update(set(moctasks))
		self.moc_done=1
开发者ID:RunarFreyr,项目名称:waz,代码行数:58,代码来源:qt4.py


示例7: apply_incpaths_ml

def apply_incpaths_ml(self):
	inc_lst = self.includes.split()
	lst = self.incpaths_lst
	for dir in inc_lst:
		node = self.path.find_dir(dir)
		if not node:
			error("node not found: " + str(dir))
			continue
		if not node in lst:
			lst.append(node)
		self.bld_incpaths_lst.append(node)
开发者ID:JodyGoldberg,项目名称:waf,代码行数:11,代码来源:ocaml.py


示例8: bibunits

 def bibunits(self):
     try:
         bibunits = bibunitscan(self)
     except FSError:
         error("error bibunitscan")
     else:
         if bibunits:
             fn = ["bu" + str(i) for i in xrange(1, len(bibunits) + 1)]
             if fn:
                 warn("calling bibtex on bibunits")
             for f in fn:
                 self.env.env = {"BIBINPUTS": self.TEXINPUTS, "BSTINPUTS": self.TEXINPUTS}
                 self.env.SRCFILE = f
                 self.check_status("error when calling bibtex", self.bibtex_fun())
开发者ID:jgoppert,项目名称:mavsim,代码行数:14,代码来源:tex.py


示例9: run

	def run(task):
		command = 'SAS'
		env = task.env
		bld = task.generator.bld

		fun = sas_fun

		node = task.inputs[0]
		logfilenode = node.change_ext('.log')
		lstfilenode = node.change_ext('.lst')

		# set the cwd
		task.cwd = task.inputs[0].parent.get_src().abspath()
		debug('runner: %s on %s' % (command, node.abspath))

		SASINPUTS = node.parent.get_bld().abspath() + os.pathsep + node.parent.get_src().abspath() + os.pathsep
		task.env.env = {'SASINPUTS': SASINPUTS}

		task.env.SRCFILE = node.abspath()
		task.env.LOGFILE = logfilenode.abspath()
		task.env.LSTFILE = lstfilenode.abspath()
		ret = fun(task)
		if ret:
			error('Running %s on %r returned a non-zero exit' % (command, node))
			error('SRCFILE = %r' % node)
			error('LOGFILE = %r' % logfilenode)
			error('LSTFILE = %r' % lstfilenode)
		return ret
开发者ID:Dzshiftt,项目名称:Gnomescroll,代码行数:28,代码来源:sas.py


示例10: bibunits

	def bibunits(self):
		try:
			bibunits=bibunitscan(self)
		except FSError:
			error('error bibunitscan')
		else:
			if bibunits:
				fn=['bu'+str(i)for i in xrange(1,len(bibunits)+1)]
				if fn:
					warn('calling bibtex on bibunits')
				for f in fn:
					self.env.env={'BIBINPUTS':self.TEXINPUTS,'BSTINPUTS':self.TEXINPUTS}
					self.env.SRCFILE=f
					self.check_status('error when calling bibtex',self.bibtex_fun())
开发者ID:HariKishan8,项目名称:Networks,代码行数:14,代码来源:tex.py


示例11: bibfile

	def bibfile(self):
		try:
			ct=self.aux_node.read()
		except(OSError,IOError):
			error('error bibtex scan')
		else:
			fo=g_bibtex_re.findall(ct)
			if fo:
				warn('calling bibtex')
				self.env.env={}
				self.env.env.update(os.environ)
				self.env.env.update({'BIBINPUTS':self.TEXINPUTS,'BSTINPUTS':self.TEXINPUTS})
				self.env.SRCFILE=self.aux_node.name[:-4]
				self.check_status('error when calling bibtex',self.bibtex_fun())
开发者ID:HariKishan8,项目名称:Networks,代码行数:14,代码来源:tex.py


示例12: apply_intltool_in_f

def apply_intltool_in_f(self):
    """
    Create tasks to translate files by intltool-merge::

        def build(bld):
            bld(
                features  = "intltool_in",
                podir     = "../po",
                flags     = ["-d", "-q", "-u", "-c"],
                source    = 'kupfer.desktop.in',
                install_path = "${DATADIR}/applications",
            )

    :param podir: location of the .po files
    :type podir: string
    :param source: source files to process
    :type source: list of string
    :param flags: compilation flags ("-quc" by default)
    :type flags: list of string
    :param install_path: installation path
    :type install_path: string
    """
    try:
        self.meths.remove('process_source')
    except ValueError:
        pass

    if not self.env.LOCALEDIR:
        self.env.LOCALEDIR = self.env.PREFIX + '/share/locale'

    for i in self.to_list(self.source):
        node = self.path.find_resource(i)

        podir = getattr(self, 'podir', 'po')
        podirnode = self.path.find_dir(podir)
        if not podirnode:
            error("could not find the podir %r" % podir)
            continue

        cache = getattr(self, 'intlcache', '.intlcache')
        self.env['INTLCACHE'] = os.path.join(self.path.bldpath(), podir, cache)
        self.env['INTLPODIR'] = podirnode.bldpath()
        self.env['INTLFLAGS'] = getattr(self, 'flags', ['-q', '-u', '-c'])

        task = self.create_task('intltool', node, node.change_ext(''))
        inst = getattr(self, 'install_path', '${LOCALEDIR}')
        if inst:
            self.bld.install_files(inst, task.outputs)
开发者ID:pbx,项目名称:kupfer,代码行数:48,代码来源:intltool.py


示例13: bibfile

	def bibfile(self):
		need_bibtex=False
		try:
			for aux_node in self.aux_nodes:
				ct=aux_node.read()
				if g_bibtex_re.findall(ct):
					need_bibtex=True
					break
		except(OSError,IOError):
			error('error bibtex scan')
		else:
			if need_bibtex:
				warn('calling bibtex')
				self.env.env={}
				self.env.env.update(os.environ)
				self.env.env.update({'BIBINPUTS':self.TEXINPUTS,'BSTINPUTS':self.TEXINPUTS})
				self.env.SRCFILE=self.aux_nodes[0].name[:-4]
				self.check_status('error when calling bibtex',self.bibtex_fun())
开发者ID:ETLin,项目名称:ns3-h264-svc,代码行数:18,代码来源:tex.py


示例14: iapply_intltool_in_f

def iapply_intltool_in_f(self):
    try:
        self.meths.remove("process_source")
    except ValueError:
        pass
    for i in self.to_list(self.source):
        node = self.path.find_resource(i)
        podir = getattr(self, "podir", "po")
        podirnode = self.path.find_dir(podir)
        if not podirnode:
            error("could not find the podir %r" % podir)
            continue
        cache = getattr(self, "intlcache", ".intlcache")
        self.env["INTLCACHE"] = os.path.join(self.path.bldpath(self.env), podir, cache)
        self.env["INTLPODIR"] = podirnode.srcpath(self.env)
        self.env["INTLFLAGS"] = getattr(self, "flags", ["-q", "-u", "-c"])
        task = self.create_task("intltool", node, node.change_ext(""))
        task.install_path = self.install_path
开发者ID:RunarFreyr,项目名称:waz,代码行数:18,代码来源:intltool.py


示例15: bibunits

	def bibunits(self):
		"""
		Parse the *.aux* file to find bibunit files. If there are bibunit files,
		execute :py:meth:`waflib.Tools.tex.tex.bibtex_fun`.
		"""
		try:
			bibunits = bibunitscan(self)
		except FSError:
			error('error bibunitscan')
		else:
			if bibunits:
				fn  = ['bu' + str(i) for i in xrange(1, len(bibunits) + 1)]
				if fn:
					warn('calling bibtex on bibunits')

				for f in fn:
					self.env.env = {'BIBINPUTS': self.TEXINPUTS, 'BSTINPUTS': self.TEXINPUTS}
					self.env.SRCFILE = f
					self.check_status('error when calling bibtex', self.bibtex_fun())
开发者ID:ita1024,项目名称:node,代码行数:19,代码来源:tex.py


示例16: iapply_intltool_in_f

def iapply_intltool_in_f(self):
	try: self.meths.remove('process_source')
	except ValueError: pass

	for i in self.to_list(self.source):
		node = self.path.find_resource(i)

		podir = getattr(self, 'podir', 'po')
		podirnode = self.path.find_dir(podir)
		if not podirnode:
			error("could not find the podir %r" % podir)
			continue

		cache = getattr(self, 'intlcache', '.intlcache')
		self.env['INTLCACHE'] = os.path.join(self.path.bldpath(self.env), podir, cache)
		self.env['INTLPODIR'] = podirnode.srcpath(self.env)
		self.env['INTLFLAGS'] = getattr(self, 'flags', ['-q', '-u', '-c'])

		task = self.create_task('intltool', node, node.change_ext(''))
		task.install_path = self.install_path
开发者ID:zsx,项目名称:waf,代码行数:20,代码来源:intltool.py


示例17: run

	def run(self):
		env=self.env
		if not env['PROMPT_LATEX']:
			env.append_value('LATEXFLAGS','-interaction=batchmode')
			env.append_value('PDFLATEXFLAGS','-interaction=batchmode')
			env.append_value('XELATEXFLAGS','-interaction=batchmode')
		fun=self.texfun
		node=self.inputs[0]
		srcfile=node.abspath()
		texinputs=self.env.TEXINPUTS or''
		self.TEXINPUTS=node.parent.get_bld().abspath()+os.pathsep+node.parent.get_src().abspath()+os.pathsep+texinputs+os.pathsep
		self.aux_node=node.change_ext('.aux')
		self.cwd=self.inputs[0].parent.get_bld().abspath()
		warn('first pass on %s'%self.__class__.__name__)
		self.env.env={}
		self.env.env.update(os.environ)
		self.env.env.update({'TEXINPUTS':self.TEXINPUTS})
		self.env.SRCFILE=srcfile
		self.check_status('error when calling latex',fun())
		self.aux_nodes=self.scan_aux(node.change_ext('.aux'))
		self.idx_node=node.change_ext('.idx')
		self.bibfile()
		self.bibunits()
		self.makeindex()
		hash=''
		for i in range(10):
			prev_hash=hash
			try:
				hashes=[Utils.h_file(x.abspath())for x in self.aux_nodes]
				hash=Utils.h_list(hashes)
			except(OSError,IOError):
				error('could not read aux.h')
				pass
			if hash and hash==prev_hash:
				break
			warn('calling %s'%self.__class__.__name__)
			self.env.env={}
			self.env.env.update(os.environ)
			self.env.env.update({'TEXINPUTS':self.TEXINPUTS})
			self.env.SRCFILE=srcfile
			self.check_status('error when calling %s'%self.__class__.__name__,fun())
开发者ID:ETLin,项目名称:ns3-h264-svc,代码行数:41,代码来源:tex.py


示例18: bibfile

	def bibfile(self):
		"""
		Parse the *.aux* file to find a bibfile to process.
		If yes, execute :py:meth:`waflib.Tools.tex.tex.bibtex_fun`
		"""
		try:
			ct = self.aux_node.read()
		except (OSError, IOError):
			error('error bibtex scan')
		else:
			fo = g_bibtex_re.findall(ct)

			# there is a .aux file to process
			if fo:
				warn('calling bibtex')

				self.env.env = {}
				self.env.env.update(os.environ)
				self.env.env.update({'BIBINPUTS': self.TEXINPUTS, 'BSTINPUTS': self.TEXINPUTS})
				self.env.SRCFILE = self.aux_node.name[:-4]
				self.check_status('error when calling bibtex', self.bibtex_fun())
开发者ID:ita1024,项目名称:node,代码行数:21,代码来源:tex.py


示例19: run

	def run(self):
		env = self.env
		gen = self.generator
		path = gen.path
		bld = gen.bld
		bjam = gen.bld.root.find_dir(env.BJAM_SRC)
		if not bjam:
			error('Can not find bjam source')
			return -1
		bjam_exe_relpath = 'bin.' + env.BJAM_UNAME + '/bjam'
		bjam_exe = bjam.find_resource(bjam_exe_relpath)
		if bjam_exe:
			env.BJAM = bjam_exe.srcpath()
			return 0
		bjam_cmd = ['./build.sh']
		debug('runner: ' + bjam.srcpath() + '> ' + str(bjam_cmd))
		result = self.exec_command(bjam_cmd, cwd=bjam.srcpath())
		if not result == 0:
			error('bjam failed')
			return -1
		bjam_exe = bjam.find_resource(bjam_exe_relpath)
		if bjam_exe:
			env.BJAM = bjam_exe.srcpath()
			return 0
		error('bjam failed')
		return -1
开发者ID:Dzshiftt,项目名称:Gnomescroll,代码行数:26,代码来源:bjam.py


示例20: run

 def run(self):
     env = self.env
     bld = self.generator.bld
     if not env["PROMPT_LATEX"]:
         env.append_value("LATEXFLAGS", "-interaction=batchmode")
         env.append_value("PDFLATEXFLAGS", "-interaction=batchmode")
         env.append_value("XELATEXFLAGS", "-interaction=batchmode")
     fun = self.texfun
     node = self.inputs[0]
     srcfile = node.abspath()
     self.TEXINPUTS = node.parent.get_bld().abspath() + os.pathsep + node.parent.get_src().abspath() + os.pathsep
     self.aux_node = node.change_ext(".aux")
     self.idx_node = node.change_ext(".idx")
     self.cwd = self.inputs[0].parent.get_bld().abspath()
     warn("first pass on %s" % self.__class__.__name__)
     self.env.env = {}
     self.env.env.update(os.environ)
     self.env.env.update({"TEXINPUTS": self.TEXINPUTS})
     self.env.SRCFILE = srcfile
     self.check_status("error when calling latex", fun())
     self.bibfile()
     self.bibunits()
     self.makeindex()
     hash = ""
     for i in range(10):
         prev_hash = hash
         try:
             hash = Utils.h_file(self.aux_node.abspath())
         except (OSError, IOError):
             error("could not read aux.h -> %s" % self.aux_node.abspath())
             pass
         if hash and hash == prev_hash:
             break
         warn("calling %s" % self.__class__.__name__)
         self.env.env = {}
         self.env.env.update(os.environ)
         self.env.env.update({"TEXINPUTS": self.TEXINPUTS})
         self.env.SRCFILE = srcfile
         self.check_status("error when calling %s" % self.__class__.__name__, fun())
开发者ID:jgoppert,项目名称:mavsim,代码行数:39,代码来源:tex.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python Logs.warn函数代码示例发布时间:2022-05-26
下一篇:
Python Logs.debug函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap