wakepy
wakepy copied to clipboard
Make it possible for the user to select the used method
On linux, there are multiple methods which could be used:
- jeepney (dbus without libdbus)
- dbus-python (dbus with libdbus)
- systemd
These all are tried in order. It would be nicer for the user if the method could be selected when setting the keepawake. An iterable of methods could also be accepted.
Possible syntax:
with keepawake(method_linux='jeepney'):
...
or
with keepawake(method_linux=('jeepney', 'systemd')):
...
etc.
Working on this & planning to put it to the next release.
This should be done now, and available in the dev branch. Will merge to master and publish a version in PyPI once tests and docs are also ready.
I'm reconsidering if this should be part of 0.8.0 yet. There are already quite many changes coming, so it might be good to get those published anyway. If this is really easy task to implement and test, going to push it in 0.8.0. Otherwise, add in another release.
My main concern is about the correct API for this. Should it be possible to select the used methods or to give the priority order or to do both? Methods for the "current platform" should probably be always prioritized before any other methods (as the others will not be used).
The implementation is already merged in dev
and will be part of 0.8.0. This still needs documentation in order to be closed.