本文整理汇总了Python中waflib.Logs.warn函数的典型用法代码示例。如果您正苦于以下问题:Python warn函数的具体用法?Python warn怎么用?Python warn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了warn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: find_msvc
def find_msvc(conf):
if sys.platform=='cygwin':
conf.fatal('MSVC module does not work under cygwin Python!')
v=conf.env
path=v['PATH']
compiler=v['MSVC_COMPILER']
version=v['MSVC_VERSION']
compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
v.MSVC_MANIFEST=(compiler=='msvc'and version>=8)or(compiler=='wsdk'and version>=6)or(compiler=='intel'and version>=11)
cxx=conf.find_program(compiler_name,var='CXX',path_list=path)
env=dict(conf.environ)
if path:env.update(PATH=';'.join(path))
if not conf.cmd_and_log(cxx+['/nologo','/help'],env=env):
conf.fatal('the msvc compiler could not be identified')
v['CC']=v['CXX']=cxx
v['CC_NAME']=v['CXX_NAME']='msvc'
if not v['LINK_CXX']:
link=conf.find_program(linker_name,path_list=path)
if link:v['LINK_CXX']=link
else:conf.fatal('%s was not found (linker)'%linker_name)
v['LINK']=link
if not v['LINK_CC']:
v['LINK_CC']=v['LINK_CXX']
if not v['AR']:
stliblink=conf.find_program(lib_name,path_list=path,var='AR')
if not stliblink:return
v['ARFLAGS']=['/NOLOGO']
if v.MSVC_MANIFEST:
conf.find_program('MT',path_list=path,var='MT')
v['MTFLAGS']=['/NOLOGO']
try:
conf.load('winres')
except Errors.WafError:
warn('Resource compiler not found. Compiling resource file is disabled')
示例2: find_ifort_win32
def find_ifort_win32(conf):
v=conf.env
path=v['PATH']
compiler=v['MSVC_COMPILER']
version=v['MSVC_VERSION']
compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
v.IFORT_MANIFEST=(compiler=='intel'and version>=11)
fc=conf.find_program(compiler_name,var='FC',path_list=path)
env=dict(conf.environ)
if path:env.update(PATH=';'.join(path))
if not conf.cmd_and_log(fc+['/nologo','/help'],env=env):
conf.fatal('not intel fortran compiler could not be identified')
v['FC_NAME']='IFORT'
if not v['LINK_FC']:
conf.find_program(linker_name,var='LINK_FC',path_list=path,mandatory=True)
if not v['AR']:
conf.find_program(lib_name,path_list=path,var='AR',mandatory=True)
v['ARFLAGS']=['/NOLOGO']
if v.IFORT_MANIFEST:
conf.find_program('MT',path_list=path,var='MT')
v['MTFLAGS']=['/NOLOGO']
try:
conf.load('winres')
except Errors.WafError:
warn('Resource compiler not found. Compiling resource file is disabled')
示例3: find_msvc
def find_msvc(conf):
"""Due to path format limitations, limit operation only to native Win32. Yeah it sucks."""
if sys.platform == 'cygwin':
conf.fatal('MSVC module does not work under cygwin Python!')
# the autodetection is supposed to be performed before entering in this method
v = conf.env
path = v['PATH']
compiler = v['MSVC_COMPILER']
version = v['MSVC_VERSION']
compiler_name, linker_name, lib_name = _get_prog_names(conf, compiler)
v.MSVC_MANIFEST = (compiler == 'msvc' and version >= 8) or (compiler == 'wsdk' and version >= 6) or (compiler == 'intel' and version >= 11)
# compiler
cxx = None
if v['CXX']: cxx = v['CXX']
elif 'CXX' in conf.environ: cxx = conf.environ['CXX']
cxx = conf.find_program(compiler_name, var='CXX', path_list=path)
cxx = conf.cmd_to_list(cxx)
# before setting anything, check if the compiler is really msvc
env = dict(conf.environ)
if path: env.update(PATH = ';'.join(path))
if not conf.cmd_and_log(cxx + ['/nologo', '/help'], env=env):
conf.fatal('the msvc compiler could not be identified')
# c/c++ compiler
v['CC'] = v['CXX'] = cxx
v['CC_NAME'] = v['CXX_NAME'] = 'msvc'
# linker
if not v['LINK_CXX']:
link = conf.find_program(linker_name, path_list=path)
if link: v['LINK_CXX'] = link
else: conf.fatal('%s was not found (linker)' % linker_name)
v['LINK'] = link
if not v['LINK_CC']:
v['LINK_CC'] = v['LINK_CXX']
# staticlib linker
if not v['AR']:
stliblink = conf.find_program(lib_name, path_list=path, var='AR')
if not stliblink: return
v['ARFLAGS'] = ['/NOLOGO']
# manifest tool. Not required for VS 2003 and below. Must have for VS 2005 and later
if v.MSVC_MANIFEST:
conf.find_program('MT', path_list=path, var='MT')
v['MTFLAGS'] = ['/NOLOGO']
try:
conf.load('winres')
except Errors.WafError:
warn('Resource compiler not found. Compiling resource file is disabled')
示例4: find_boost_includes
def find_boost_includes(self, kw):
"""
check every path in kw['includes'] for subdir
that either starts with boost- or is named boost.
Then the version is checked and selected accordingly to
min_version/max_version. The highest possible version number is
selected!
If no versiontag is set the versiontag is set accordingly to the
selected library and INCLUDES_BOOST is set.
"""
boostPath = getattr(Options.options, 'boostincludes', '')
if boostPath:
boostPath = [os.path.normpath(os.path.expandvars(os.path.expanduser(boostPath)))]
else:
boostPath = Utils.to_list(kw['includes'])
min_version = string_to_version(kw.get('min_version', ''))
max_version = string_to_version(kw.get('max_version', '')) or (sys.maxint - 1)
version = 0
for include_path in boostPath:
boost_paths = [p for p in glob.glob(os.path.join(include_path, 'boost*')) if os.path.isdir(p)]
debug('BOOST Paths: %r' % boost_paths)
for path in boost_paths:
pathname = os.path.split(path)[-1]
ret = -1
if pathname == 'boost':
path = include_path
ret = self.get_boost_version_number(path)
elif pathname.startswith('boost-'):
ret = self.get_boost_version_number(path)
ret = int(ret)
if ret != -1 and ret >= min_version and ret <= max_version and ret > version:
boost_path = path
version = ret
if not version:
self.fatal('boost headers not found! (required version min: %s max: %s)'
% (kw['min_version'], kw['max_version']))
return False
found_version = version_string(version)
versiontag = '^' + found_version + '$'
if kw['tag_version'] is None:
kw['tag_version'] = versiontag
elif kw['tag_version'] != versiontag:
warn('boost header version %r and tag_version %r do not match!' % (versiontag, kw['tag_version']))
env = self.env
env['INCLUDES_BOOST'] = boost_path
env['BOOST_VERSION'] = found_version
self.found_includes = 1
ret = '%s (ver %s)' % (boost_path, found_version)
return ret
示例5: makeindex
def makeindex(self):
try:
idx_path=self.idx_node.abspath()
os.stat(idx_path)
except OSError:
warn('index file %s absent, not calling makeindex'%idx_path)
else:
warn('calling makeindex')
self.env.SRCFILE=self.idx_node.name
self.env.env={}
self.check_status('error when calling makeindex %s'%idx_path,self.makeindex_fun())
示例6: makeindex
def makeindex(self):
"""look on the filesystem if there is a .idx file to process"""
try:
idx_path = self.idx_node.abspath()
os.stat(idx_path)
except OSError:
warn('index file %s absent, not calling makeindex' % idx_path)
else:
warn('calling makeindex')
self.env.SRCFILE = self.idx_node.name
self.env.env = {}
self.check_status('error when calling makeindex %s' % idx_path, self.makeindex_fun())
示例7: configure
def configure(conf):
try:
conf.find_program('python',var='PYTHON')
except conf.errors.ConfigurationError:
warn("could not find a python executable, setting to sys.executable '%s'"%sys.executable)
conf.env.PYTHON=sys.executable
if conf.env.PYTHON!=sys.executable:
warn("python executable '%s' different from sys.executable '%s'"%(conf.env.PYTHON,sys.executable))
v=conf.env
v['PYCMD']='"import sys, py_compile;py_compile.compile(sys.argv[1], sys.argv[2])"'
v['PYFLAGS']=''
v['PYFLAGS_OPT']='-O'
v['PYC']=getattr(Options.options,'pyc',1)
v['PYO']=getattr(Options.options,'pyo',1)
示例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())
示例9: 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())
示例10: 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())
示例11: configure
def configure(conf):
try:
conf.find_program("python", var="PYTHON")
except conf.errors.ConfigurationError:
warn("could not find a python executable, setting to sys.executable '%s'" % sys.executable)
conf.env.PYTHON = sys.executable
if conf.env.PYTHON != sys.executable:
warn("python executable '%s' different from sys.executable '%s'" % (conf.env.PYTHON, sys.executable))
conf.env.PYTHON = conf.cmd_to_list(conf.env.PYTHON)
v = conf.env
v["PYCMD"] = '"import sys, py_compile;py_compile.compile(sys.argv[1], sys.argv[2])"'
v["PYFLAGS"] = ""
v["PYFLAGS_OPT"] = "-O"
v["PYC"] = getattr(Options.options, "pyc", 1)
v["PYO"] = getattr(Options.options, "pyo", 1)
示例12: makeindex
def makeindex(self):
"""
Look on the filesystem if there is a *.idx* file to process. If yes, execute
:py:meth:`waflib.Tools.tex.tex.makeindex_fun`
"""
try:
idx_path = self.idx_node.abspath()
os.stat(idx_path)
except OSError:
warn('index file %s absent, not calling makeindex' % idx_path)
else:
warn('calling makeindex')
self.env.SRCFILE = self.idx_node.name
self.env.env = {}
self.check_status('error when calling makeindex %s' % idx_path, self.makeindex_fun())
示例13: bibunits
def bibunits(self):
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]
if not self.env['PROMPT_LATEX']:
self.env.append_unique('BIBERFLAGS', '--quiet')
path = self.aux_node.abspath()[:-4] + '.bcf'
if os.path.isfile(path):
warn('calling biber')
self.check_status('error when calling biber, check %s.blg for errors' % (self.env.SRCFILE), self.biber_fun())
else:
super(tex, self).bibfile()
super(tex, self).bibunits()
示例14: 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())
示例15: find_msvc
def find_msvc(conf):
if sys.platform=='cygwin':
conf.fatal('MSVC module does not work under cygwin Python!')
v=conf.env
compiler,version,path,includes,libdirs=detect_msvc(conf)
v['PATH']=path
v['INCLUDES']=includes
v['LIBPATH']=libdirs
v['MSVC_VERSION']=float(version)
compiler_name,linker_name,lib_name=_get_prog_names(conf,compiler)
v.MSVC_MANIFEST=(compiler=='msvc'and float(version)>=8)or(compiler=='wsdk'and float(version)>=6)or(compiler=='intel'and float(version)>=11)
cxx=None
if v['CXX']:cxx=v['CXX']
elif'CXX'in conf.environ:cxx=conf.environ['CXX']
cxx=conf.find_program(compiler_name,var='CXX',path_list=path)
cxx=conf.cmd_to_list(cxx)
env=dict(conf.environ)
env.update(PATH=';'.join(path))
if not conf.cmd_and_log(cxx+['/nologo','/help'],env=env):
conf.fatal('the msvc compiler could not be identified')
v['CC']=v['CXX']=cxx
v['CC_NAME']=v['CXX_NAME']='msvc'
try:v.prepend_value('INCLUDES',conf.environ['INCLUDE'])
except KeyError:pass
try:v.prepend_value('LIBPATH',conf.environ['LIB'])
except KeyError:pass
if not v['LINK_CXX']:
link=conf.find_program(linker_name,path_list=path)
if link:v['LINK_CXX']=link
else:conf.fatal('%s was not found (linker)'%linker_name)
v['LINK']=link
if not v['LINK_CC']:
v['LINK_CC']=v['LINK_CXX']
if not v['AR']:
stliblink=conf.find_program(lib_name,path_list=path,var='AR')
if not stliblink:return
v['ARFLAGS']=['/NOLOGO']
if v.MSVC_MANIFEST:
mt=conf.find_program('MT',path_list=path,var='MT')
v['MTFLAGS']=['/NOLOGO']
conf.load('winres')
if not conf.env['WINRC']:
warn('Resource compiler not found. Compiling resource file is disabled')