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