From a8bc3a58fd81d05ec70d8b37373972237128a9ec Mon Sep 17 00:00:00 2001 From: Denis Demidov Date: Fri, 4 Nov 2016 17:18:32 +0300 Subject: [PATCH] Use warning directive for warning clauses --- ev3dev/core.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/ev3dev/core.py b/ev3dev/core.py index bc53140..d529a80 100644 --- a/ev3dev/core.py +++ b/ev3dev/core.py @@ -843,15 +843,16 @@ def wait_until(self, s, timeout=None): Blocks until ``s`` is in ``self.state``. The condition is checked when there is an I/O event related to the ``state`` attribute. Exits early when ``timeout`` (in milliseconds) is reached. - - **Warning:** In ev3dev kernel release cycles 16 and earlier, there is - a bug which causes the ``state`` attribute to include ``stalled`` - immediately after starting the motor even if it is not actually being - prevented from rotating. As a workaround, we recommend sleeping your - code for around 100ms after starting a motor if you are going to use - this method to wait for it to be ``stalled``. A fix for this has not - yet been released. - + + .. warning:: + In ev3dev kernel release cycles 16 and earlier, there is a bug + which causes the ``state`` attribute to include ``stalled`` + immediately after starting the motor even if it is not actually + being prevented from rotating. As a workaround, we recommend + sleeping your code for around 100ms after starting a motor if you + are going to use this method to wait for it to be ``stalled``. A + fix for this has not yet been released. + Returns ``True`` if the condition is met, and ``False`` if the timeout is reached. @@ -866,15 +867,16 @@ def wait_while(self, s, timeout=None): Blocks until ``s`` is not in ``self.state``. The condition is checked when there is an I/O event related to the ``state`` attribute. Exits early when ``timeout`` (in milliseconds) is reached. - - **Warning:** In ev3dev kernel release cycles 16 and earlier, there is - a bug which causes the ``state`` attribute to include ``stalled`` - immediately after starting the motor even if it is not actually being - prevented from rotating. As a workaround, we recommend sleeping your - code for around 100ms after starting a motor if you are going to use - this method to wait for it to be ``stalled``. A fix for this has not - yet been released. - + + .. warning:: + In ev3dev kernel release cycles 16 and earlier, there is a bug + which causes the ``state`` attribute to include ``stalled`` + immediately after starting the motor even if it is not actually + being prevented from rotating. As a workaround, we recommend + sleeping your code for around 100ms after starting a motor if you + are going to use this method to wait for it to be ``stalled``. A + fix for this has not yet been released. + Returns ``True`` if the condition is met, and ``False`` if the timeout is reached.