本文整理匯總了Python中waflib.Errors.ConfigurationError方法的典型用法代碼示例。如果您正苦於以下問題:Python Errors.ConfigurationError方法的具體用法?Python Errors.ConfigurationError怎麽用?Python Errors.ConfigurationError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類waflib.Errors
的用法示例。
在下文中一共展示了Errors.ConfigurationError方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test
# 需要導入模塊: from waflib import Errors [as 別名]
# 或者: from waflib.Errors import ConfigurationError [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
示例2: conf
# 需要導入模塊: from waflib import Errors [as 別名]
# 或者: from waflib.Errors import ConfigurationError [as 別名]
def conf(f):
def fun(*k,**kw):
mandatory=True
if'mandatory'in kw:
mandatory=kw['mandatory']
del kw['mandatory']
try:
return f(*k,**kw)
except Errors.ConfigurationError:
if mandatory:
raise
setattr(ConfigurationContext,f.__name__,fun)
setattr(Build.BuildContext,f.__name__,fun)
return f
示例3: conf
# 需要導入模塊: from waflib import Errors [as 別名]
# 或者: from waflib.Errors import ConfigurationError [as 別名]
def conf(f):
def fun(*k,**kw):
mandatory=True
if'mandatory'in kw:
mandatory=kw['mandatory']
del kw['mandatory']
try:
return f(*k,**kw)
except Errors.ConfigurationError:
if mandatory:
raise
fun.__name__=f.__name__
setattr(ConfigurationContext,f.__name__,fun)
setattr(Build.BuildContext,f.__name__,fun)
return f