From 1e858172519e9339e4720b8bf9b39b6d9801e305 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 28 May 2022 19:29:08 -0700 Subject: Tweak around docstring to make prettier sphinx autodocs. --- thread_utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'thread_utils.py') diff --git a/thread_utils.py b/thread_utils.py index 01755de..5903782 100644 --- a/thread_utils.py +++ b/thread_utils.py @@ -72,7 +72,7 @@ def background_thread( *** event as an input parameter and should periodically check *** *** it and stop if the event is set. *** - Usage: + Usage:: @background_thread def random(a: int, b: str, stop_event: threading.Event) -> None: @@ -82,7 +82,6 @@ def background_thread( if stop_event.is_set(): return - def main() -> None: (thread, event) = random(22, "dude") print("back!") @@ -131,13 +130,12 @@ def periodically_invoke( Returns a Thread object and an Event that, when signaled, will stop the invocations. Note that it is possible to be invoked one time after the Event is set. This event can be used to stop infinite - invocation style or finite invocation style decorations. + invocation style or finite invocation style decorations.:: @periodically_invoke(period_sec=0.5, stop_after=None) def there(name: str, age: int) -> None: print(f" ...there {name}, {age}") - @periodically_invoke(period_sec=1.0, stop_after=3) def hello(name: str) -> None: print(f"Hello, {name}") -- cgit v1.3