本文整理匯總了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)