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


Python voluptuous.ALLOW_EXTRA属性代码示例

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


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

示例1: create_schema

# 需要导入模块: import voluptuous [as 别名]
# 或者: from voluptuous import ALLOW_EXTRA [as 别名]
def create_schema():
    global options
    # Miss out CONFIG_SCHEMA_PARAMETERS1a and use CONFIG_SCHEMA instead
    dest = {**CONFIG_SCHEMA, **create_parameters1cv(options), **create_parameters2cv(options), **create_parameters3cv(options), **create_parameters4cv(options)}
    #_LOGGER.info("Visonic create schema = {0}".format(dest))
    return dest # vol.Schema({ DOMAIN: vol.Schema(dest), }, extra=vol.ALLOW_EXTRA ) 
开发者ID:davesmeghead,项目名称:visonic,代码行数:8,代码来源:create_schema.py

示例2: schema

# 需要导入模块: import voluptuous [as 别名]
# 或者: from voluptuous import ALLOW_EXTRA [as 别名]
def schema(self) -> vol.Schema:
        return vol.Schema({}, extra=vol.ALLOW_EXTRA) 
开发者ID:schipholgroup,项目名称:takeoff,代码行数:4,代码来源:test_deploy.py

示例3: load_tcconfig

# 需要导入模块: import voluptuous [as 别名]
# 或者: from voluptuous import ALLOW_EXTRA [as 别名]
def load_tcconfig(self, config_file_path):
        from voluptuous import Schema, Required, Any, ALLOW_EXTRA

        schema = Schema(
            {Required(str): {Any(*TrafficDirection.LIST): {str: {str: Any(str, int, float)}}}},
            extra=ALLOW_EXTRA,
        )

        with open(config_file_path, encoding="utf-8") as fp:
            self.__config_table = json.load(fp)

        schema(self.__config_table)
        self.__logger.debug(
            "tc config file: {:s}".format(json.dumps(self.__config_table, indent=4))
        ) 
开发者ID:thombashi,项目名称:tcconfig,代码行数:17,代码来源:_importer.py

示例4: _validate

# 需要导入模块: import voluptuous [as 别名]
# 或者: from voluptuous import ALLOW_EXTRA [as 别名]
def _validate(self):
        schema = Schema(
            All(self._schema, *self._custom_validators),
            extra=ALLOW_EXTRA,
        )
        schema(self._confdata) 
开发者ID:italia,项目名称:spid-testenv2,代码行数:8,代码来源:config.py

示例5: input_schema

# 需要导入模块: import voluptuous [as 别名]
# 或者: from voluptuous import ALLOW_EXTRA [as 别名]
def input_schema(cls):
        return vol.Schema(cls._input_schema_dict, extra=vol.ALLOW_EXTRA) 
开发者ID:flav-io,项目名称:flavio,代码行数:4,代码来源:instanceio.py

示例6: schema

# 需要导入模块: import voluptuous [as 别名]
# 或者: from voluptuous import ALLOW_EXTRA [as 别名]
def schema(self, extended=True, extra=vol.ALLOW_EXTRA):
        """Returns the extended schema of the class"""

        if extended is False:
            return getattr_explicit(
                type(self), self._schema_attr, vol.Schema({}))

        schema = vol.Schema({}, extra=extra)
        classes = inspect.getmro(self)[::-1]
        for c in classes:
            c_schema = getattr_explicit(c, self._schema_attr, None)
            if c_schema is not None:
                schema = schema.extend(c_schema.schema)

        return schema 
开发者ID:ahodges9,项目名称:LedFx,代码行数:17,代码来源:utils.py


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