Skip to content

Commit

Permalink
'Which method was used?'
Browse files Browse the repository at this point in the history
  • Loading branch information
fohrloop committed May 25, 2024
1 parent bfe0058 commit c823afd
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/source/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,26 @@ Example output (notice that `run_long_task` was never called):
Failed to keep system awake using keep.running mode
started
exiting
```
```


(which-method-was-used))=
## Which wakepy Method was used?

When you would like to check *how* exactly did wakepy do what you asked it to,
you can check the used method from the {class}`Mode <wakepy.Mode>` instance.

**Example**

```python
from wakepy import keep

with keep.running() as m:
print('active_method:', m.active_method)
print('used_method:', m.used_method)

print('--------')
print('active_method:', m.active_method)
print('used_method:', m.used_method)
```

0 comments on commit c823afd

Please sign in to comment.