OSDN Git Service

Add code doc.
authorJames Teh <jamie@jantrid.net>
Wed, 10 Nov 2010 11:45:59 +0000 (21:45 +1000)
committerJames Teh <jamie@jantrid.net>
Wed, 10 Nov 2010 11:45:59 +0000 (21:45 +1000)
source/NVDAObjects/behaviors.py

index 7d8ec6b..8cb9ce0 100755 (executable)
@@ -169,6 +169,11 @@ class LiveText(NVDAObject):
                self._keepMonitoring = False\r
 \r
        def startMonitoring(self):\r
+               """Start monitoring for new text.\r
+               New text will be reported when it is detected.\r
+               @note: If monitoring has already been started, this will have no effect.\r
+               @see: L{stopMonitoring}\r
+               """\r
                if self._monitorThread:\r
                        return\r
                self._monitorThread = threading.Thread(target=self._monitor)\r
@@ -177,6 +182,10 @@ class LiveText(NVDAObject):
                self._monitorThread.start()\r
 \r
        def stopMonitoring(self):\r
+               """Stop monitoring previously started with L{startMonitoring}.\r
+               @note: If monitoring has not been started, this will have no effect.\r
+               @see: L{startMonitoring}\r
+               """\r
                if not self._monitorThread:\r
                        return\r
                self._keepMonitoring = False\r
@@ -184,6 +193,9 @@ class LiveText(NVDAObject):
                self._monitorThread = None\r
 \r
        def event_textChange(self):\r
+               """Fired when the text changes.\r
+               @note: It is safe to call this directly from threads other than the main thread.\r
+               """\r
                self._event.set()\r
 \r
        def _getTextLines(self):\r