本文整理汇总了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)
示例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)
示例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)
示例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)