parameters: (self, optionDefs, optionkeywords)
docstring: addoptions(optionDefs) - add option def to option info
docstring_summary: addoptions(optionDefs) - add option def to option info
docstring_tokens: addoptions ( optionDefs ) - add option def to option info
function: def addoptions(self, optionDefs, optionkeywords):
          """ addoptions(optionDefs) - add option def to option info """
          # Add additional options, providing the default value and the
          # method to call when the value is changed.  See
          # "defineoptions" for more details
  
          # optimisations:
          optionInfo = self._optionInfo
          optionInfo_has_key = optionInfo.__contains__
          keywords = self._constructorKeywords
          keywords_has_key = keywords.__contains__
          FUNCTION = DGG._OPT_FUNCTION
  
          for name, default, function in optionDefs:
              if '_' not in name:
                  default = optionkeywords.get(name, default)
                  # The option will already exist if it has been defined
                  # in a derived class.  In this case, do not override the
                  # default value of the option or the callback function
                  # if it is not None.
                  if not optionInfo_has_key(name):
                      if keywords_has_key(name):
                          # Overridden by keyword, use keyword value
                          value = keywords[name][0]
                          optionInfo[name] = [default, value, function]
                          # Delete it from self._constructorKeywords
                          del keywords[name]
                      else:
                          # Use optionDefs value
                          optionInfo[name] = [default, default, function]
                  elif optionInfo[name][FUNCTION] is None:
                      # Only override function if not defined by derived class
                      optionInfo[name][FUNCTION] = function
              else:
                  # This option is of the form "component_option".  If this is
                  # not already defined in self._constructorKeywords add it.
                  # This allows a derived class to override the default value
                  # of an option of a component of a base class.
                  if not keywords_has_key(name):
                      keywords[name] = [default, 0]
function_tokens: def addoptions ( self , optionDefs , optionkeywords ) : # Add additional options, providing the default value and the # method to call when the value is changed.  See # "defineoptions" for more details # optimisations: optionInfo = self . _optionInfo optionInfo_has_key = optionInfo . __contains__ keywords = self . _constructorKeywords keywords_has_key = keywords . __contains__ FUNCTION = DGG . _OPT_FUNCTION for name , default , function in optionDefs : if '_' not in name : default = optionkeywords . get ( name , default ) # The option will already exist if it has been defined # in a derived class.  In this case, do not override the # default value of the option or the callback function # if it is not None. if not optionInfo_has_key ( name ) : if keywords_has_key ( name ) : # Overridden by keyword, use keyword value value = keywords [ name ] [ 0 ] optionInfo [ name ] = [ default , value , function ] # Delete it from self._constructorKeywords del keywords [ name ] else : # Use optionDefs value optionInfo [ name ] = [ default , default , function ] elif optionInfo [ name ] [ FUNCTION ] is None : # Only override function if not defined by derived class optionInfo [ name ] [ FUNCTION ] = function else : # This option is of the form "component_option".  If this is # not already defined in self._constructorKeywords add it. # This allows a derived class to override the default value # of an option of a component of a base class. if not keywords_has_key ( name ) : keywords [ name ] = [ default , 0 ]