當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。