parameters: (self, obj, fixit=0)
return_statement: return error_list
docstring: Check the object's consistency.
        We are looking the definition of the constraing where
        are defined the minimum and the maximum arity, and the
        list of objects we wants to check the arity.
docstring_summary: Check the object's consistency.
        We are looking the definition of the constraing where
        are defined the minimum and the maximum arity, and the
        list of objects we wants to check the arity.
docstring_tokens: Check the object s consistency . We are looking the definition of the constraing where are defined the minimum and the maximum arity and the list of objects we wants to check the arity .
function: def _checkConsistency(self, obj, fixit=0):
      """Check the object's consistency.
        We are looking the definition of the constraing where
        are defined the minimum and the maximum arity, and the
        list of objects we wants to check the arity.
      """
      error_list = []
      # Retrieve configuration values from PropertySheet (_constraints)
      base_category = self.constraint_definition['base_category']
      min_arity = int(self.constraint_definition['min_arity'])
      max_arity = None
      if 'max_arity' in self.constraint_definition:
        max_arity = int(self.constraint_definition['max_arity'])
      portal_type = self.constraint_definition['portal_type']
      # Check arity and compare it with the min and max
      arity = self._calculateArity(obj)
      if not (max_arity is None and (min_arity <= arity)
          or (min_arity <= arity <= max_arity)):
        mapping = dict(base_category=base_category,
                       portal_type=str(portal_type),
                       current_arity=arity,
                       min_arity=min_arity,
                       max_arity=max_arity,)
        # Generate error message
        if portal_type is not ():
          if max_arity is None:
            message_id = 'message_arity_with_portal_type_to_small'
          else:
            message_id = 'message_arity_with_portal_type_not_in_range'
        else:
          if max_arity is None:
            message_id = 'message_arity_too_small'
          else:
            message_id = 'message_arity_not_in_range'
  
        # Add error
        error_list.append(self._generateError(obj,
                                self._getMessage(message_id), mapping))
      return error_list
function_tokens: def _checkConsistency ( self , obj , fixit = 0 ) : error_list = [ ] # Retrieve configuration values from PropertySheet (_constraints) base_category = self . constraint_definition [ 'base_category' ] min_arity = int ( self . constraint_definition [ 'min_arity' ] ) max_arity = None if 'max_arity' in self . constraint_definition : max_arity = int ( self . constraint_definition [ 'max_arity' ] ) portal_type = self . constraint_definition [ 'portal_type' ] # Check arity and compare it with the min and max arity = self . _calculateArity ( obj ) if not ( max_arity is None and ( min_arity <= arity ) or ( min_arity <= arity <= max_arity ) ) : mapping = dict ( base_category = base_category , portal_type = str ( portal_type ) , current_arity = arity , min_arity = min_arity , max_arity = max_arity , ) # Generate error message if portal_type is not ( ) : if max_arity is None : message_id = 'message_arity_with_portal_type_to_small' else : message_id = 'message_arity_with_portal_type_not_in_range' else : if max_arity is None : message_id = 'message_arity_too_small' else : message_id = 'message_arity_not_in_range' # Add error error_list . append ( self . _generateError ( obj , self . _getMessage ( message_id ) , mapping ) ) return error_list