本文整理匯總了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)