class core.control.manager.ControlContainer[source]

Bases: openalea.grapheditor.observer.Observed, openalea.grapheditor.observer.AbstractListener

>>> from openalea.core.control.manager import ControlContainer
add(name, **kwds)[source]

Convenience method to create a control and add it to container. See Control.

>>> container = ControlContainer()
>>> container.add('i', interface='IInt', value=1)
Control('i', IInt, value=1)
Parameters:
  • name -- Control name
  • kwds -- Control keywords like interface, value, ...
add_control(control)[source]
Parameters:control -- Control object
changed()[source]

Like namespace() but dictionnary contains only controls with value different than default value.

clear()[source]
clear_followers()[source]
control(name=None, uid=None)[source]

Return all control with name "name". If no control found, returns None, if only one found, returns it else return a list of control.

If uid is passed, returns corresponding control or None if not found. If uid is passed, it never returns a list as uid is unique.

controls()[source]

Returns a list of Control objects.

disable_followers()[source]
enable_followers()[source]
namespace(interface=None)[source]

Returns namespace (dict control name -> value). :param tag: returns namespace corresponding to given tag.

Default, returns global namespace
notify(sender, event)[source]
register_follower(name, func)[source]
remove_control(control)[source]
Parameters:control -- Control object
unregister_follower(name)[source]
update(dic)[source]

Update controls with dict values. If a name is not referenced in ControlContainer, nothing is done.

Note

Example:

Let "container" a Container with one control "a" with value 1:

container:
    - a:IInt = 1

after container.update({'a':2, 'b':3}) we get

container:
  • a:IInt = 2
Parameters:dic -- dict name -> value
class core.control.manager.ControlManager[source]

Bases: core.control.manager.ControlContainer

class core.control.manager.Follower(name, func)[source]

Bases: openalea.grapheditor.observer.AbstractListener

follow_events()[source]
ignore_events()[source]
notify(*args, **kwargs)[source]
core.control.manager.control_dict()[source]

Get the controls from the control manager in a dictionary (key = name, value = object)

Returns:dict of controls

Previous topic

<no title>

Next topic

<no title>

This Page