本文整理汇总了Python中sprinter.formulabase.FormulaBase.validate方法的典型用法代码示例。如果您正苦于以下问题:Python FormulaBase.validate方法的具体用法?Python FormulaBase.validate怎么用?Python FormulaBase.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sprinter.formulabase.FormulaBase
的用法示例。
在下文中一共展示了FormulaBase.validate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validate
# 需要导入模块: from sprinter.formulabase import FormulaBase [as 别名]
# 或者: from sprinter.formulabase.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()))
示例2: validate
# 需要导入模块: from sprinter.formulabase import FormulaBase [as 别名]
# 或者: from sprinter.formulabase.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)
示例3: validate
# 需要导入模块: from sprinter.formulabase import FormulaBase [as 别名]
# 或者: from sprinter.formulabase.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.formulabase import FormulaBase [as 别名]
# 或者: from sprinter.formulabase.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)