ResourcesFactory
digraph inheritanceb63c7d19b9 {
bgcolor=transparent;
rankdir=UD;
ratio=compress;
size="8.0, 12.0";
"Logger" [URL="taurus-Logger.html#taurus.Logger",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="The taurus logger class. All taurus pertinent classes should inherit"];
"ResourcesFactory" [URL="#taurus.core.resource.ResourcesFactory",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A Singleton class designed to provide Simulation related objects."];
"Singleton" -> "ResourcesFactory" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusFactory" -> "ResourcesFactory" [arrowsize=0.5,style="setlinewidth(0.5)"];
"Logger" -> "ResourcesFactory" [arrowsize=0.5,style="setlinewidth(0.5)"];
"Singleton" [URL="taurus.core.util.singleton-Singleton.html#taurus.core.util.singleton.Singleton",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="This class allows Singleton objects"];
"TaurusFactory" [URL="taurus.core.taurusfactory-TaurusFactory.html#taurus.core.taurusfactory.TaurusFactory",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="The base class for valid Factories in Taurus."];
}
- class ResourcesFactory(*p, **k)[source]
A Singleton class designed to provide Simulation related objects.
Import from
taurus.core.resource
as:from taurus.core.resource import ResourcesFactory
- DftResourceName = 'taurus_resources.py'
the default resource file name
- DftResourcePriority = 10
priority for the default resource
- findObjectClass(absolute_name)[source]
Obtain the class object corresponding to the given name.
- Parameters:
absolute_name (str) – the object absolute name string
- Returns:
the class for the model object mapped by absolute_name, or None if absolute_name is invalid.
- Return type:
- getAttribute(name)[source]
Obtain the attribute model object referenced by name.
- Parameters:
name (str) – name
- Returns:
attribute object :raise: (taurus.core.taurusexception.TaurusException) if name is invalid
- Return type:
- getAuthority(name=None)[source]
Obtain the authority model object referenced by name.
- Parameters:
name (str) – name
- Returns:
authority object :raise: (taurus.core.taurusexception.TaurusException) if name is invalid
- Return type:
- getDevice(name)[source]
Obtain the device model object referenced by name.
- Parameters:
name (str) – name
- Returns:
device object :raise: (taurus.core.taurusexception.TaurusException) if name is invalid
- Return type:
- getValue(key)[source]
Returns the value for a given key
- Parameters:
key (str) – a key
- Returns:
the value for the given key
- Return type:
str
- loadResource(obj=None, priority=1, name=None)
(Re)Loads the given resource.
- Parameters:
obj (dict or file or None) – the resource object. Default is None meaning in will (re)load the default resource: taurus_resources.py from the application directory
priority (int) – the resource priority. Default is 1 meaning maximum priority
name (str) – an optional name to give to the resource
- Returns:
a dictionary version of the given resource object
- Return type:
dict
- reloadResource(obj=None, priority=1, name=None)[source]
(Re)Loads the given resource.
- Parameters:
obj (dict or file or None) – the resource object. Default is None meaning in will (re)load the default resource: taurus_resources.py from the application directory
priority (int) – the resource priority. Default is 1 meaning maximum priority
name (str) – an optional name to give to the resource
- Returns:
a dictionary version of the given resource object
- Return type:
dict
- schemes = ('res', 'resource')
‘res’ and ‘resources’ are the supported schemes
- Type:
the list of schemes that this factory supports. For this factory