|
From: Sergi R. <sr...@ce...> - 2015-08-05 15:26:47
|
Merci!!!, just to provide a bit of context; it was to clarify that isPollingEnabled()==True does not mean that the polling is active. enablePolling(True) must be called if you don't have any registered listener. Srj On 08/05/2015 01:44 PM, Zbigniew Reszela wrote: > From: zreszela <zre...@ce...> > > --- > lib/taurus/core/taurusattribute.py | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/lib/taurus/core/taurusattribute.py b/lib/taurus/core/taurusattribute.py > index 1f66be5..cee5f03 100644 > --- a/lib/taurus/core/taurusattribute.py > +++ b/lib/taurus/core/taurusattribute.py > @@ -250,6 +250,12 @@ class TaurusAttribute(TaurusModel): > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- > > def enablePolling(self, force=False): > + '''Enable polling. See :meth:`isPollingEnabled` for clarification of > + what enabled polling means. > + > + :param force: True also activates polling (see: :meth:`activatePolling`) > + :type force: bool > + ''' > self.__enable_polling = True > self.__forced_polling = force > if force: > @@ -259,12 +265,25 @@ class TaurusAttribute(TaurusModel): > self._activatePolling() > > def disablePolling(self): > + '''Disable polling and if polling is active also deactivate it. > + See :meth:`isPollingEnabled` for clarification of > + what enabled polling means. > + ''' > self.__enable_polling = False > self.__forced_polling = False > if self.__activate_polling: > self._deactivatePolling() > > def isPollingEnabled(self): > + '''Indicate whether polling was activated/deactivated by user. > + Enabled polling does not mean that it is active - periodically poll > + the attribute. By default the attribute creation enables polling. > + > + :return: whether polling is enabled > + :type: bool > + > + :see: :meth:`enablePolling`, :meth:`disablePolling` > + ''' > return self.__enable_polling > > def _activatePolling(self): > @@ -280,6 +299,14 @@ class TaurusAttribute(TaurusModel): > self.__polled = False > > def isPollingActive(self): > + '''Indicate whether polling is active. Active polling means that > + a periodic timer poll the attribute. By default the attribute creation > + does not activate polling. > + > + :return: whether polling is active > + :type: bool > + :see: :meth:`activatePolling`, :meth:`disablePolling` > + ''' > return self.__polled > > def isPollingForced(self): |