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

-
class
SardanaContainer
[source]¶ A container class for sardana elements
-
add_element
(e)[source]¶ Adds a new
pool.PoolObject
to this container- Parameters
e (
pool.PoolObject
) – the pool element to be added
-
remove_element
(e)[source]¶ Removes the
pool.PoolObject
from this container- Parameters
e (
pool.PoolObject
) – the pool object to be removed- Throw
KeyError
-
get_element_id_map
()[source]¶ Returns a reference to the internal pool object ID map
- Returns
the internal pool object ID map
- Return type
dict<id, pool.PoolObject>
-
get_element_name_map
()[source]¶ Returns a reference to the internal pool object name map
- Returns
the internal pool object name map
- Return type
dict<str, pool.PoolObject>
-
get_element_type_map
()[source]¶ Returns a reference to the internal pool object type map
- Returns
the internal pool object type map
- Return type
dict<pool.ElementType, dict<id, pool.PoolObject>>
-
get_element
(**kwargs)[source]¶ Returns a reference to the requested pool object
- Parameters
kwargs – 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
- Returns
the pool object
- Return type
pool.PoolObject
- Throw
KeyError
-
get_element_by_name
(name, **kwargs)[source]¶ Returns a reference to the requested pool object
- Parameters
name (
str
) – pool object name- Returns
the pool object
- Return type
pool.PoolObject
- Throw
KeyError
-
get_element_by_full_name
(full_name, **kwargs)[source]¶ Returns a reference to the requested pool object
- Parameters
name (
str
) – pool object full name- Returns
the pool object
- Return type
pool.PoolObject
- Throw
KeyError
-
get_element_by_id
(id, **kwargs)[source]¶ Returns a reference to the requested pool object
- Parameters
id (int) – pool object ID
- Returns
the pool object
- Return type
pool.PoolObject
- Throw
KeyError
-
get_elements_by_type
(t)[source]¶ Returns a list of all pool objects of the given type
- Parameters
t (pool.ElementType) – element type
- Returns
list of pool objects
- Return type
seq<pool.PoolObject>
-
get_element_names_by_type
(t)[source]¶ Returns a list of all pool object names of the given type
- Parameters
t (pool.ElementType) – element type
- Returns
list of pool object names
- Return type
seq<str>
-