sardanacontainer

This module is part of the Python Pool libray. It defines the base classes for a pool container element

Classes

SardanaContainer

Inheritance diagram of SardanaContainer
class SardanaContainer[source]

A container class for sardana elements

add_element(e)[source]

Adds a new pool.PoolObject to this container

Parameters:

e (PoolObject) – the pool element to be added

Return type:

PoolObject

remove_element(e)[source]

Removes the pool.PoolObject from this container

Parameters:

e (PoolObject) – the pool object to be removed

Throw:

KeyError

Return type:

None

get_element_id_map()[source]

Returns a reference to the internal pool object ID map

Return type:

Dict[int, PoolObject]

Returns:

the internal pool object ID map

get_element_name_map()[source]

Returns a reference to the internal pool object name map

Return type:

Dict[str, PoolObject]

Returns:

the internal pool object name map

get_element_type_map()[source]

Returns a reference to the internal pool object type map

Return type:

Dict[ElementType, Dict[int, PoolObject]]

Returns:

the internal pool object type map

get_element(**kwargs)[source]

Returns a reference to the requested pool object

Parameters:

kwargs (Any) – if key ‘id’ given: search by ID else if key ‘full_name’ given: search by full name else if key ‘name’ given: search by name

Return type:

PoolObject

Returns:

the pool object

Throw:

KeyError

get_element_by_name(name, **kwargs)[source]

Returns a reference to the requested pool object

Parameters:

name (str) – pool object name

Return type:

PoolObject

Returns:

the pool object

Throw:

KeyError

get_element_by_full_name(full_name, **kwargs)[source]

Returns a reference to the requested pool object

Parameters:

name – pool object full name

Return type:

PoolObject

Returns:

the pool object

Throw:

KeyError

get_element_by_id(id, **kwargs)[source]

Returns a reference to the requested pool object

Parameters:

id (int) – pool object ID

Return type:

PoolObject

Returns:

the pool object

Throw:

KeyError

get_elements_by_type(t)[source]

Returns a list of all pool objects of the given type

Parameters:

t (ElementType) – element type

Return type:

Sequence[PoolObject]

Returns:

list of pool objects

get_element_names_by_type(t)[source]

Returns a list of all pool object names of the given type

Parameters:

t (ElementType) – element type

Return type:

Sequence[str]

Returns:

list of pool object names

rename_element(old_name, new_name)[source]

Rename an object

Parameters:
  • old_name (str) – old object name

  • new_name (str) – new object name

Return type:

None

check_element(name, full_name)[source]