当前位置: 首页>>代码示例>>Python>>正文


Python ModelDataBase._validateAndConvertAttribute方法代码示例

本文整理汇总了Python中testmanager.core.base.ModelDataBase._validateAndConvertAttribute方法的典型用法代码示例。如果您正苦于以下问题:Python ModelDataBase._validateAndConvertAttribute方法的具体用法?Python ModelDataBase._validateAndConvertAttribute怎么用?Python ModelDataBase._validateAndConvertAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在testmanager.core.base.ModelDataBase的用法示例。


在下文中一共展示了ModelDataBase._validateAndConvertAttribute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _validateAndConvertAttribute

# 需要导入模块: from testmanager.core.base import ModelDataBase [as 别名]
# 或者: from testmanager.core.base.ModelDataBase import _validateAndConvertAttribute [as 别名]
    def _validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb):
        # Handle asType and asOsArches specially.
        if sAttr == 'sType':
            (oNewValue, sError) = ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue,
                                                                             aoNilValues, fAllowNull, oDb);
            if sError is None:
                if len(self.asTypes) <= 0:
                    oNewValue = None;
                else:
                    for sType in oNewValue:
                        if len(sType) < 2  or  sType.lower() != sType:
                            if sError is None:  sError  = '';
                            else:               sError += ', ';
                            sError += 'invalid value "%s"' % (sType,);

        elif sAttr == 'asOsArches':
            (oNewValue, sError) = self.validateListOfStr(oValue, aoNilValues = aoNilValues, fAllowNull = fAllowNull,
                                                         asValidValues = coreconsts.g_kasOsDotCpusAll);
            if sError is not None  and  oNewValue is not None:
                oNewValue = sorted(oNewValue); # Must be sorted!

        elif sAttr == 'cSecMaxAge' and oValue not in aoNilValues: # Allow human readable interval formats.
            (oNewValue, sError) = utils.parseIntervalSeconds(oValue);
        else:
            return ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb);

        return (oNewValue, sError);
开发者ID:mcenirm,项目名称:vbox,代码行数:29,代码来源:buildsource.py

示例2: _validateAndConvertAttribute

# 需要导入模块: from testmanager.core.base import ModelDataBase [as 别名]
# 或者: from testmanager.core.base.ModelDataBase import _validateAndConvertAttribute [as 别名]
    def _validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb):
        # Handle sType and asOsArches specially.
        if sAttr == 'sType':
            (oNewValue, sError) = ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue,
                                                                             aoNilValues, fAllowNull, oDb);
            if sError is None  and  self.sType.lower() != self.sType:
                sError = 'Invalid build type value';

        elif sAttr == 'asOsArches':
            (oNewValue, sError) = self.validateListOfStr(oValue, aoNilValues = aoNilValues, fAllowNull = fAllowNull,
                                                         asValidValues = coreconsts.g_kasOsDotCpusAll);
            if sError is not None  and  oNewValue is not None:
                oNewValue = sorted(oNewValue); # Must be sorted!

        else:
            return ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb);

        return (oNewValue, sError);
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:20,代码来源:build.py

示例3: _validateAndConvertAttribute

# 需要导入模块: from testmanager.core.base import ModelDataBase [as 别名]
# 或者: from testmanager.core.base.ModelDataBase import _validateAndConvertAttribute [as 别名]
    def _validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb):
        if sAttr == 'cSecTimeout' and oValue not in aoNilValues: # Allow human readable interval formats.
            return utils.parseIntervalSeconds(oValue);

        (oValue, sError) = ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb);
        if sError is None:
            if sAttr == 'sTestBoxReqExpr':
                sError = TestCaseData.validateTestBoxReqExpr(oValue);
            elif sAttr == 'sBuildReqExpr':
                sError = TestCaseData.validateBuildReqExpr(oValue);
        return (oValue, sError);
开发者ID:swimming198243,项目名称:virtualbox,代码行数:13,代码来源:testcaseargs.py

示例4: _validateAndConvertAttribute

# 需要导入模块: from testmanager.core.base import ModelDataBase [as 别名]
# 或者: from testmanager.core.base.ModelDataBase import _validateAndConvertAttribute [as 别名]
    def _validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb):
        # Custom handling of the email field.
        if sAttr == 'sEmail':
            return ModelDataBase.validateEmail(oValue, aoNilValues = aoNilValues, fAllowNull = fAllowNull);

        # Automatically lowercase the login name if we're supposed to do case
        # insensitive matching.  (The feature assumes lower case in DB.)
        if sAttr == 'sLoginName' and oValue is not None and config.g_kfLoginNameCaseInsensitive:
            oValue = oValue.lower();

        return ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb);
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:13,代码来源:useraccount.py

示例5: _validateAndConvertAttribute

# 需要导入模块: from testmanager.core.base import ModelDataBase [as 别名]
# 或者: from testmanager.core.base.ModelDataBase import _validateAndConvertAttribute [as 别名]
    def _validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb):
        if sAttr != 'aidTestCaseArgs':
            return ModelDataBase._validateAndConvertAttribute(self, sAttr, sParam, oValue, aoNilValues, fAllowNull, oDb);

        # -1 is a special value, which when present make the whole thing NULL (None).
        (aidVariations, sError) = self.validateListOfInts(oValue, aoNilValues = aoNilValues, fAllowNull = fAllowNull,
                                                          iMin = -1, iMax = 0x7ffffffe);
        if sError is None:
            if aidVariations is None:
                pass;
            elif -1 in aidVariations:
                aidVariations = None;
            elif 0 in aidVariations:
                sError = 'Invalid test case varation ID #0.';
            else:
                aidVariations = sorted(aidVariations);
        return (aidVariations, sError);
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:19,代码来源:testgroup.py


注:本文中的testmanager.core.base.ModelDataBase._validateAndConvertAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。