|
From: Zbigniew R. <zre...@ce...> - 2015-08-05 11:44:16
|
Dear all, In the following mail I propose documentation of some taurusattribute polling related methods. My understanding of them is based on some emprirical tests. Feel free to comment, Zibi |
|
From: Zbigniew R. <zre...@ce...> - 2015-08-05 11:44:17
|
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):
--
1.8.4.5
|
|
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): |
|
From: Carlos P. <cpa...@ce...> - 2015-08-18 11:28:46
|
Patch applied to develop. I just changed the :type: sphinx directive by the current standard of taurus of putting the type in parentheses. On Wed 5 August 2015 13:44:07 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): -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |