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


Python Schema.__doc__方法代码示例

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


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

示例1: Schema

# 需要导入模块: from voluptuous import Schema [as 别名]
# 或者: from voluptuous.Schema import __doc__ [as 别名]
#!/usr/bin/env python
__all__ = [
    "Environment", "EnvironmentalDataPoint", "FirmwareModule",
    "FirmwareModuleType", "Recipe", "SoftwareModule", "SoftwareModuleType"
]

from openag_lib.firmware.categories import SENSORS, ACTUATORS, CALIBRATION, all_categories
from voluptuous import Schema, Required, Any, Extra, Optional, REMOVE_EXTRA

Environment = Schema({
    "name": Any(str, unicode),
}, extra=REMOVE_EXTRA)
Environment.__doc__ = """
An :class:`Environment` abstractly represents a single homogenous
climate-controlled volume within a system. A food computer usually consists of
a single :class:`Environment`, but larger systems will often contain more than
one :class:`Environment`.

.. py:attribute:: name

    (str) A human-readable name for the environment
"""

EnvironmentalDataPoint = Schema({
    Required("environment"): Any(str, unicode),
    Required("variable"): Any(str, unicode),
    Required("is_manual", default=False): bool,
    Required("is_desired"): bool,
    "value": object,
    Required("timestamp"): Any(float, int),
}, extra=REMOVE_EXTRA)
开发者ID:OpenAgInitiative,项目名称:openag_brain,代码行数:33,代码来源:models.py


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