taurus

The main taurus module. It contains a reduced set of wrappers around the real taurus model classes and information regarding the current release.

Modules

Classes

Functions

Attribute(dev_or_attr_name, attr_name=None)[source]

Returns the taurus attribute for either the pair (device name, attribute name) or full attribute name

  • Attribute(full_attribute_name)
  • Attribute(device_name, attribute_name)

It is a shortcut to:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory()
attribute  = factory.getAttribute(full_attribute_name)

or:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory()
device  = factory.getDevice(device_name)
attribute = device.getAttribute(attribute_name)
Parameters:
  • dev_or_attr_name (str or TaurusDevice) – the device name or full attribute name
  • attr_name (str) – attribute name
Returns:

a taurus attribute

Return type:

taurus.core.taurusattribute.TaurusAttribute

Authority(name=None)[source]

Returns a taurus authority

It is a shortcut to:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory()
db  = factory.getAuthority(dname)
Parameters:name (str or None) – authority name. If None (default) it will return the default authority of the default scheme. For example, if the default scheme is tango, it will return the default TANGO_HOST database
Returns:a taurus authority
Return type:taurus.core.taurusauthority.TaurusAuthority
Configuration(*args, **kwargs)
Returns the taurus configuration for either the pair

(attribute name, conf name) or full conf name

  • Configuration(full_conf_name)
  • Configuration(attribute_name, conf_name)

It is a shortcut to:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory()
conf  = factory.getConfiguration(attr_or_conf_name)

or:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory()
attribute  = factory.getAttribute(attribute_name)
conf = attribute.getConfig(conf_name)
param attr_or_conf_name:
 the full attribute name or full conf name
type attr_or_conf_name:
 str
param conf_name:
 conf name
type conf_name:str or None
return:a taurus configuration
rtype:taurus.core.taurusconfiguration.TaurusConfiguration

Deprecated since version 4.0: Use Attribute instead

Database(*args, **kwargs)

Deprecated since version 4.0: Use Authority instead

Device(device_name)[source]

Returns the taurus device for the given device name

It is a shortcut to:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory()
device  = factory.getDevice(device_name)
Parameters:device_name (str) – the device name
Returns:a taurus device
Return type:taurus.core.taurusdevice.TaurusDevice
Factory(scheme=None)[source]

Returns the one and only Factory for the given scheme

It is a shortcut to:

import taurus.core.taurusmanager
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory(scheme)
Parameters:scheme (str) – a string representing the scheme. Default value is None meaning tango scheme
Returns:a taurus factory
Return type:taurus.core.taurusfactory.TaurusFactory
Manager()[source]

Returns the one and only TaurusManager

It is a shortcut to:

import taurus.core
manager = taurus.core.taurusmanager.TaurusManager()
Returns:the TaurusManager
Return type:taurus.core.taurusmanager.TaurusManager

See also

taurus.core.taurusmanager.TaurusManager

Object(*args)[source]

Returns an taurus object of given class for the given name

Can be called as:

  • Object(name)
  • Object(cls, name)

Where:

  • name is a model name (str)
  • cls is a class derived from TaurusModel

If cls is not given, Object() will try to guess it from name.

Returns:a taurus object
Return type:taurus.core.taurusmodel.TaurusModel
changeDefaultPollingPeriod(period)[source]
check_dependencies()[source]

Prints a check-list of requirements and marks those that are fulfilled

critical(msg, *args, **kw)[source]
debug(msg, *args, **kw)[source]
deprecated(*args, **kw)[source]
error(msg, *args, **kw)[source]
fatal(msg, *args, **kw)[source]
getSchemeFromName(name, implicit=True)[source]

Return the scheme from a taurus name.

Parameters:
  • name (str) – taurus model name URI.
  • implicit (bool) – controls whether to return the default scheme (if implicit is True -default-) or None (if implicit is False) in case model does not contain the scheme name explicitly. The default scheme may be defined in Taurus custom settings (‘tango’ is assumed if not defined)
getValidTypesForName(name, strict=None)[source]

Returns a list of all Taurus element types for which name is a valid model name (while in many cases a name may only be valid for one element type, this is not necessarily true in general)

Parameters:
  • name (str) – taurus model name
  • strict (bool) – If True, names that are not RFC3986-compliant but which would be accepted for backwards compatibility are considered valid.
Return type:

list <element>

Returns:

where element can be one of: Attribute, Device or Authority

getValidatorFromName(name)[source]

Helper for obtaining the validator object corresponding to the given name.

Returns:model name validator or None if name is not a supported model name
info(msg, *args, **kw)[source]
isValidName(name, etypes=None, strict=None)[source]

Returns True is the given name is a valid Taurus model name. If etypes is passed, it returns True only if name is valid for at least one of the given the element types. Otherwise it returns False. For example:

isValidName('tango:foo')--> True
isValidName('tango:a/b/c', [TaurusElementType.Attribute]) --> False
Parameters:
  • name (str) – the string to be checked for validity
  • etypes (seq <TaurusElementType>) – if given, names will only be considered valid if they represent one of the given element types. Supported element types are: Attribute, Device and Authority
  • strict (bool) – If True, names that are not RFC3986-compliant but which would be accepted for backwards compatibility are considered valid.
Return type:

bool

Returns:

log(level, msg, *args, **kw)
log_dependencies()[source]

deprecated since ‘4.0.4’

makeSchemeExplicit(name, default=None)[source]

return the name guaranteeing that the scheme is present. If name already contains the scheme, it is returned unchanged.

Parameters:
  • name (str) – taurus model name URI.
  • default (str) – The default scheme to use. If no default is passed, the one defined in tauruscustomsettings.DEFAULT_SCHEME is used.
Returns:

the name with the explicit scheme.

trace(msg, *args, **kw)[source]
warning(msg, *args, **kw)[source]