示例#1
0
    def __setattr__(self, key, value):
        Component.__setattr__(self, key, value)
        if key in ('alignCenter', 'autoFocus', 'autoScroll', 'border', 'dock',
                   'isTrade', 'layout', 'region', 'hidden'):
            raise AttributeError('{}.{} is READ ONLY'.format(
                type(self).__name__, key))
        if key in ('fieldLabel', 'cls', 'dict'):
            if not isinstance(value, str) and not isinstance(value, unicode):
                raise AttributeError('{}.{} is JUST ONLY str'.format(
                    type(self).__name__, key))
        elif key in ('x', 'y', 'height', 'labelWidth'):
            if not isinstance(value, int):
                raise AttributeError('{}.{} is JUST ONLY int'.format(
                    type(self).__name__, key))
        elif key in ('labelTextAlign', 'textAlign'):
            if value not in ('center', 'left', 'right'):
                raise AttributeError(
                    '{}.{} is JUST ONLY AS center, left, right'.format(
                        type(self).__name__, key))
        elif key == 'inputMethod':
            if value not in ('normal', 'notempty', 'readonly'):
                raise AttributeError(
                    '{}.{} is JUST ONLY AS normal, notempty, readonly'.format(
                        type(self).__name__, key))

        self.__dict__[key] = value
示例#2
0
 def __setattr__(self, key, value):
     Component.__setattr__(self, key, value)
     if key == 'storeType':
         if value not in ('constant','file'):
             raise AttributeError('{}.{} is JUST ONLY AS constant or file'.format(type(self).__name__, key))
     elif key in('items'):
         if not isinstance(value, list):
             raise AttributeError('{}.{} is JUST ONLY list'.format(type(self).__name__, key))
     elif key in('hidden','sortable','visible'):
         if value not in ('true','false'):
             raise AttributeError('{}.{} is JUST ONLY AS true or false'.format(type(self).__name__, key))
     elif key in('align'):
         if value not in ('left','center','right'):
             raise AttributeError('{}.{} is JUST ONLY AS left,center,right'.format(type(self).__name__, key))
     elif key == 'displayType':
         if value not in ('constant','text'):
             raise AttributeError('{}.{} is JUST ONLY AS constant or text'.format(type(self).__name__, key))
     elif key == 'dataType':
         if value not in ('string','currency','select'):
             raise AttributeError('{}.{} is JUST ONLY AS select, currency, string'.format(type(self).__name__, key))
     elif key in('flex'):
         if not isinstance(value, int):
             raise AttributeError('{}.{} is JUST ONLY int'.format(type(self).__name__, key))
     elif key in('storeFile'):
         if not isinstance(value, dict):
             raise AttributeError('{}.{} is JUST ONLY dict'.format(type(self).__name__, key))
     elif key in('cls','filterName'):
         if not isinstance(value, str):
             raise AttributeError('{}.{} is JUST ONLY str'.format(type(self).__name__, key))
     elif key in('dataIndex','dateFormat','displayType','editable','inputMethod','isKey','locked','maxLength','maxValue','minLength','minValue','relationField'):
         raise AttributeError('{}.{} is JUST ONLY'.format(type(self).__name__, key))
     self.__dict__[key] = value
示例#3
0
 def __setattr__(self, key, value):
     Component.__setattr__(self, key, value)
     if key == 'store':
         if not isinstance(value, dict):
             raise AttributeError('{}.{} is JUST ONLY dict'.format(
                 type(self).__name__, key))
     elif key == 'showNumber':
         if value not in ('true', 'false'):
             raise AttributeError(
                 '{}.{} is JUST ONLY as true or false'.format(
                     type(self).__name__, key))
     elif key == 'rowSizeOfPage':
         if not isinstance(value, int):
             raise AttributeError('{}.{} is JUST ONLY int'.format(
                 type(self).__name__, key))
     elif key == 'enableColumnResize':
         if not isinstance(value, dict):
             raise AttributeError('{}.{} is JUST ONLY dict'.format(
                 type(self).__name__, key))
     elif key == 'checkFlag':
         if value not in ('single', 'multi', 'none'):
             raise AttributeError(
                 '{}.{} is JUST ONLY as single, multi, none'.format(
                     type(self).__name__, key))
     elif key == 'collapsible':
         if value not in ('true', 'false'):
             raise AttributeError(
                 '{}.{} is JUST ONLY as true or false'.format(
                     type(self).__name__, key))
     elif key == 'columns':
         if not isinstance(value, list):
             raise AttributeError('{}.{} is JUST ONLY list'.format(
                 type(self).__name__, key))
     self.__dict__[key] = value
示例#4
0
    def __setattr__(self, key, value):
        Component.__setattr__(self, key, value)
        if key in ('alignCenter', 'autoFocus', 'autoScroll', 'border', 'dock',
                   'id', 'isTrade', 'layout', 'qualifiedId', 'region'):
            raise AttributeError('{}.{} is READ ONLY'.format(
                type(self).__name__, key))
        elif key in ('x', 'y', 'height'):
            if not isinstance(value, int):
                raise AttributeError('{}.{} is JUST ONLY int'.format(
                    type(self).__name__, key))
        elif key == 'items':
            if not isinstance(value, list):
                raise AttributeError('{}.{} is JUST ONLY list'.format(
                    type(self).__name__, key))

        self.__dict__[key] = value
示例#5
0
 def __setattr__(self, key, value):
     Component.__setattr__(self, key, value)
     self.__dict__[key] = value