本文整理汇总了Python中sprinter.formula.base.FormulaBase.validate方法的典型用法代码示例。如果您正苦于以下问题:Python FormulaBase.validate方法的具体用法?Python FormulaBase.validate怎么用?Python FormulaBase.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sprinter.formula.base.FormulaBase
的用法示例。
在下文中一共展示了FormulaBase.validate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validate
# 需要导入模块: from sprinter.formula.base import FormulaBase [as 别名]
# 或者: from sprinter.formula.base.FormulaBase import validate [as 别名]
def validate(self):
if self.target:
if (self.target.has('username') and not self.target.has('password') or
self.target.has('password') and not self.target.has('username')):
self.logger.warn("Username and password are " +
"both required to authenticate to a source!")
FormulaBase.validate(self)
示例2: validate
# 需要导入模块: from sprinter.formula.base import FormulaBase [as 别名]
# 或者: from sprinter.formula.base.FormulaBase import validate [as 别名]
def validate(self):
FormulaBase.validate(self)
config = self.target or self.source
version = config.get('version', 'r13.2')
if version not in package_dict:
raise PerforceFormulaException("Version %s in not supported by perforce formula!\n" % version +
"Supported versions are: %s" % ", ".join(package_dict.keys()))
示例3: validate
# 需要导入模块: from sprinter.formula.base import FormulaBase [as 别名]
# 或者: from sprinter.formula.base.FormulaBase import validate [as 别名]
def validate(self):
FormulaBase.validate(self)
if self.target:
versions = self.target.get('version').split('.')
if len(versions) != 3:
self._log_error("Version string %s is invalid! please format it as : X.X.X")
for v in versions:
try:
int(v)
except ValueError:
self._log_error("Versions must all be integers! %s is not one" % v)
示例4: validate
# 需要导入模块: from sprinter.formula.base import FormulaBase [as 别名]
# 或者: from sprinter.formula.base.FormulaBase import validate [as 别名]
def validate(self):
if self.target:
target_opts = self.__get_options(self.target)
for k in self._required_options:
if k not in target_opts:
error_message = "Required option {option} not present in feature {feature}!".format(
option=k, feature=self.feature_name)
if self.target.is_affirmative('fail_on_error', False):
self._log_error(error_message)
else:
self.logger.error(error_message)
return FormulaBase.validate(self)
示例5: validate
# 需要导入模块: from sprinter.formula.base import FormulaBase [as 别名]
# 或者: from sprinter.formula.base.FormulaBase import validate [as 别名]
def validate(self):
if self.target:
if not (self.target.has('egg') or self.target.has('eggs')):
self.logger.warn("No eggs will be installed! 'egg' or 'eggs' parameter not set!")
return FormulaBase.validate(self)