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


Python GraceObject.__setattr__方法代码示例

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


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

示例1: __setattr__

# 需要导入模块: from base import GraceObject [as 别名]
# 或者: from base.GraceObject import __setattr__ [as 别名]
    def __setattr__(self, key, value):

        # check type of Frame specific attribute
        if key == 'type':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 6, includeMax=False)
        GraceObject.__setattr__(self, key, value)
开发者ID:mmckerns,项目名称:pygrace,代码行数:9,代码来源:graph.py

示例2: __setattr__

# 需要导入模块: from base import GraceObject [as 别名]
# 或者: from base.GraceObject import __setattr__ [as 别名]
    def __setattr__(self, key, value):

        # check type of ErrorBar specific attribute
        if key == 'riser_clip':
            self._check_type(str, key, value)
            self._check_membership(key, value, ('on', 'off'))
        elif key == 'riser_clip_length':
            self._check_type((float, int), key, value)
            self._check_range(key, value, 0, None)

        GraceObject.__setattr__(self, key, value)
开发者ID:bjmorgan,项目名称:pygrace,代码行数:13,代码来源:dataset.py

示例3: __setattr__

# 需要导入模块: from base import GraceObject [as 别名]
# 或者: from base.GraceObject import __setattr__ [as 别名]
    def __setattr__(self, key, value):

        # check Grace specific attributes
        if key == 'width' or key == 'height':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, None)
        elif key == 'verbose':
            self._check_type(bool, key, value)
        elif key == 'version':
            self._check_type(str, key, value)
        elif key == 'background_fill':
            self._check_type(str, key, value)
            self._check_membership(key, value, ('on', 'off'))
            
        GraceObject.__setattr__(self, key, value)
开发者ID:bjmorgan,项目名称:pygrace,代码行数:17,代码来源:grace.py

示例4: __setattr__

# 需要导入模块: from base import GraceObject [as 别名]
# 或者: from base.GraceObject import __setattr__ [as 别名]
    def __setattr__(self, key, value):

        # check Graph specific attributes
        if key == 'start' or key == 'end':
            self._check_type(tuple, key, value)
        elif key == 'arrow':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 3)
        elif key == 'arrow_type':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 2)
        elif key == 'arrow_length':
            self._check_type((float, int), key, value)
            self._check_range(key, value, 0, None)
        elif key == 'arrow_layout':
            self._check_type(tuple, key, value)
            self._check_range(key, value[0], 0, None)
            self._check_range(key, value[1], 0, 1, includeMax=True)
            
        GraceObject.__setattr__(self, key, value)
开发者ID:bjmorgan,项目名称:pygrace,代码行数:22,代码来源:drawing_objects.py


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