Skip to content

Commit

Permalink
Use warning directive for warning clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Nov 4, 2016
1 parent 78c54de commit a8bc3a5
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions ev3dev/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::

This comment has been minimized.

Copy link
@WasabiFan

WasabiFan Nov 4, 2016

Member

😍

This comment has been minimized.

Copy link
@ddemidov

ddemidov Nov 4, 2016

Author Member

The comment is ambiguous. Do your eyes hurt? Or do you like the result? 😈

This comment has been minimized.

Copy link
@WasabiFan

WasabiFan Nov 4, 2016

Member

It's an elegant solution to an ugly problem, so I like it. I can't say the RST syntax is particularly elegant, but the feature is nice.

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.
Expand All @@ -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.
Expand Down

0 comments on commit a8bc3a5

Please sign in to comment.