msmetamacro
This module contains the class definition for the MacroServer meta macro information
Functions
Classes
MacroLibrary
- class MacroLibrary(**kwargs)[source]
Bases:
SardanaLibrary
Object representing a python module containing macro classes and/or macro functions. Public members:
module - reference to python module
file_path - complete (absolute) path (with file name at the end)
file_name - file name (including file extension)
path - complete (absolute) path
name - (=module name) module name (without file extension)
macros - dict<str, MacroClass>
- exc_info - exception information if an error occurred when loading
the module
- serialize(*args, **kwargs)[source]
Returns a serializable object describing this object.
- Returns:
a serializable dict
- get_macro(meta_name)
Returns a :class:~`sardana.sardanameta.SardanaCode` for the given meta name or None if the meta does not exist in this library.
- get_macros()
Returns a sequence of the meta (class and functions) that belong to this library.
- Return type:
Sequence
[SardanaCode
]- Returns:
a sequence of meta (class and functions) that belong to this library
- has_macro(meta_name)
Returns True if the given meta name belongs to this library or False otherwise.
- has_macros()
Returns True if any meta object exists in the library or False otherwise.
- Return type:
- Returns:
True if any meta object (class or function) exists in the library or False otherwise
- add_macro_class(meta_class)
Adds a new :class:~`sardana.sardanameta.SardanaClass` to this library.
- Parameters:
meta_class (
Type
[SardanaClass
]) – the meta class to be added to this library- Return type:
- get_macro_class(meta_class_name)
Returns a :class:~`sardana.sardanameta.SardanaClass` for the given meta class name or None if the meta class does not exist in this library.
- Parameters:
meta_class_name (
str
) – the meta class name- Return type:
- Returns:
a meta class or None
- get_macro_classes()
Returns a sequence of the meta classes that belong to this library.
- Return type:
- Returns:
a sequence of meta classes that belong to this library
- has_macro_class(meta_class_name)
Returns True if the given meta class name belongs to this library or False otherwise.
- add_macro_function(meta_function)
Adds a new :class:~`sardana.sardanameta.SardanaFunction` to this library.
- get_macro_function(meta_function_name)
Returns a :class:~`sardana.sardanameta.SardanaFunction` for the given meta function name or None if the meta function does not exist in this library.
- get_macro_functions()
Returns a sequence of the meta functions that belong to this library.
Parameterizable
- class Parameterizable[source]
Bases:
object
Helper class to handle parameter and result definition for a
MacroClass
or aMacroFunction
MacroClass
- class MacroClass(**kwargs)[source]
Bases:
SardanaClass
,Parameterizable
MacroFunction
- class MacroFunction(**kwargs)[source]
Bases:
SardanaFunction
,Parameterizable