Package topo :: Package base :: Module parameterclasses :: Class ClassSelectorParameter
[hide private]
[frames] | no frames]

Class ClassSelectorParameter

source code

                   object --+        
                            |        
parameterizedobject.Parameter --+    
                                |    
                SelectorParameter --+
                                    |
                                   ClassSelectorParameter
Known Subclasses:
DictParameter

Parameter whose value is an instance of the specified class.

Nested Classes [hide private]

Inherited from parameterizedobject.Parameter: __metaclass__

Instance Methods [hide private]
 
__init__(self, class_, default=None, instantiate=True, **params)
Initialize a new Parameter object: store the supplied attributes.
source code
 
_check_value(self, val, obj=None)
val must be None or an instance of self.class_
source code
 
__set__(self, obj, val)
Set the value for this Parameter.
source code
 
get_range(self)
Return the possible types for this parameter's value.
source code

Inherited from parameterizedobject.Parameter: __delete__, __get__, __getstate__, __setstate__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  __classdoc = '\n Parameter whose value is an instance of th...
str(object) -> string
Properties [hide private]
  class_

Inherited from parameterizedobject.Parameter: constant, default, doc, instantiate, precedence, readonly

Inherited from object: __class__

Method Details [hide private]

__init__(self, class_, default=None, instantiate=True, **params)
(Constructor)

source code 

Initialize a new Parameter object: store the supplied attributes.

default: the owning class's value for the attribute represented by this Parameter.

precedence is a value, usually in the range 0.0 to 1.0, that allows the order of Parameters in a class to be defined (for e.g. in GUI menus). A negative precedence indicates a parameter that should be hidden in e.g. GUI menus.

default, doc, and precedence default to None. This is to allow inheritance of Parameter slots (attributes) from the owning-class' class hierarchy (see ParameterizedObjectMetaclass).

Overrides: parameterizedobject.Parameter.__init__
(inherited documentation)

__set__(self, obj, val)

source code 

Set the value for this Parameter.

If called for a ParameterizedObject class, set that class's value (i.e. set this Parameter object's 'default' attribute).

If called for a ParameterizedObject instance, set the value of this Parameter on that instance (i.e. in the instance's __dict__, under the parameter's internal_name).

If the Parameter's constant attribute is True, only allows the value to be set for a ParameterizedObject class or on uninitialized ParameterizedObject instances.

If the Parameter's readonly attribute is True, only allows the value to be specified in the Parameter declaration inside the ParameterizedObject source code. A read-only parameter also cannot be set on a ParameterizedObject class.

Note that until we support some form of read-only object, it is still possible to change the attributes of the object stored in a constant or read-only Parameter (e.g. the left bound of a BoundingBox).

Overrides: parameterizedobject.Parameter.__set__
(inherited documentation)

get_range(self)

source code 

Return the possible types for this parameter's value.

(I.e. return {name: <class>} for all classes that are
concrete_descendents() of self.class_.)

Only classes from modules that have been imported are added
(see concrete_descendents()).

Overrides: SelectorParameter.get_range

Class Variable Details [hide private]

__classdoc

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'''
    Parameter whose value is an instance of the specified class.    
    '''