TaurusModel

Inheritance diagram of TaurusModel
class TaurusModel(full_name='', parent=None, serializationMode=None)[source]

Import from taurus.core.taurusmodel as:

from taurus.core.taurusmodel import TaurusModel
RegularEvent = (0, 1, 2)
addListener(listener)[source]
classmethod buildModelName(parent_model, relative_name)[source]
cleanUp()[source]

The cleanUp. Default implementation does nothing Overwrite when necessary

deleteListener(listener)[source]
classmethod factory()[source]
fireEvent(event_type, event_value, listeners=None)[source]

sends an event to all listeners or a specific one

forceListening()[source]
property fullname
getChildObj(child_name)[source]
getDisplayDescrObj(cache=True)[source]

A brief description of the model. Can be used as tooltip, for example.

getDisplayName(cache=True, complete=True)[source]
getEventCounts()[source]

Return event counts keyed by TaurusEventType.

Counts are collected passively when the model dispatches events. This makes them suitable for diagnostics without adding observer listeners.

getFragmentObj(fragmentName=None)[source]

Returns a fragment object of the model. A fragment is computed from a model by evaluating the expression <model>.<fragmentName>

For a simple fragmentName (no dots), this is roughly equivalent to getattr(self, fragmentName)

If the fragment cannot be computed, AttributeError is raised

Parameters:

fragmentName (str or None) – the returned value will correspond to the given fragmentName. If None is passed the defaultFragmentName will be used instead.

Returns:

the computed fragment of the modelObj.

Return type:

obj

getFullName()[source]
getLastEventTime()[source]

Return the local UNIX time of the last dispatched event.

getListeners()[source]

Return the currently registered live listeners.

The returned tuple is a snapshot. Inspecting it does not register a listener or otherwise change the model subscription state.

classmethod getNameValidator()[source]
getNormalName()[source]
getParentObj()[source]
getSerializationMode()[source]

Gives the serialization operation mode.

Returns:

the current serialization mode

Return type:

TaurusSerializationMode

getSimpleName()[source]
classmethod getTaurusElementType()[source]
hasListeners()[source]

returns True if anybody is listening to events from this attribute

classmethod isValid(*args, **kwargs)[source]
isWritable()[source]
property name
property parentObj
removeListener(listener)[source]
classmethod setEventStatisticsEnabled(enabled)[source]

Enable or disable passive event statistics for all models.

Statistics are disabled by default to avoid adding measurable work to the event dispatch hot path when diagnostics are not being used. Existing counters are preserved when collection is disabled.

setSerializationMode(mode)[source]

Sets the serialization mode for the system.

Parameters:

mode (TaurusSerializationMode) – the new serialization mode

unforceListening()[source]