ResourcesFactory
¶
digraph inheritanceb63c7d19b9 {
rankdir=UD;
ratio=compress;
size="8.0, 12.0";
"Logger" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The taurus logger class. All taurus pertinent classes should inherit"];
"Object" -> "Logger" [arrowsize=0.5,style="setlinewidth(0.5)"];
"Object" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"ResourcesFactory" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,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" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="This class allows Singleton objects"];
"TaurusFactory" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The base class for valid Factories in Taurus."];
}
-
class
ResourcesFactory
[source]¶ Bases:
taurus.core.util.singleton.Singleton
,taurus.core.taurusfactory.TaurusFactory
,taurus.core.util.log.Logger
A Singleton class designed to provide Simulation related objects.
-
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 stringReturn type: TaurusModel
orNone
Returns: the class for the model object mapped by absolute_name, or None if absolute_name is invalid.
-
getAttribute
(name)[source]¶ Obtain the attribute model object referenced by name.
Parameters: name ( str
) – nameReturn type: TaurusAttribute
Returns: attribute object Raise: ( TaurusException
) if name is invalid
-
getAuthority
(name=None)[source]¶ Obtain the authority model object referenced by name.
Parameters: name ( str
) – nameReturn type: TaurusAuthority
Returns: authority object Raise: ( TaurusException
) if name is invalid
-
getDevice
(name)[source]¶ Obtain the device model object referenced by name.
Parameters: name ( str
) – nameReturn type: TaurusDevice
Returns: device object Raise: ( TaurusException
) if name is invalid
-
getValue
(key)[source]¶ Returns the value for a given key
Parameters: key ( str
) – a keyReturn type: str
Returns: the value for the given key
-
loadResource
(obj=None, priority=1, name=None)¶ (Re)Loads the given resource.
Parameters: - obj (
dict
orfile
orNone
) – 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
Return type: dict
Returns: a dictionary version of the given resource object
- obj (
-
reloadResource
(obj=None, priority=1, name=None)[source]¶ (Re)Loads the given resource.
Parameters: - obj (
dict
orfile
orNone
) – 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
Return type: dict
Returns: a dictionary version of the given resource object
- obj (
-
schemes
= ('res', 'resource')¶ the list of schemes that this factory supports. For this factory: ‘res’ and ‘resources’ are the supported schemes
-