ResourcesFactory

Inheritance diagram of ResourcesFactory
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

clear()[source]
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:

taurus.core.taurusmodel.TaurusModel or None

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:

taurus.core.taurusattribute.TaurusAttribute

getAttributeNameValidator()[source]

Return ResourceAttributeNameValidator

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:

taurus.core.taurusauthority.TaurusAuthority

getAuthorityNameValidator()[source]

Return ResourceAuthorityNameValidator

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:

taurus.core.taurusdevice.TaurusDevice

getDeviceNameValidator()[source]

Return ResourceDeviceNameValidator

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

init(*args, **kwargs)[source]

Singleton instance initialization. For internal usage only

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