You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a Kivy multiplatform app (Android and Linux). I am trying to deal with the possible lack of a vibrator by guarding the call to .vibrate() with an .exists() check.
if plyer.vibrator.exists():
plyer.vibrator.vibrate()
plyer.vibrate.exists() currently throws a NotImplementedError on Linux.
Traceback (most recent call last):
File "/home/wegscd/.virtualenvs/KivyTest/lib/python3.8/site-packages/plyer/utils.py", line 93, in _ensure_obj
mod = __import__(module, fromlist='.')
ModuleNotFoundError: No module named 'plyer.platforms.linux.vibrator'
Traceback (most recent call last):
File "/home/wegscd/PycharmProjects/KivyTest/main.py", line 208, in <module>
TabbedPanelApp().run()
File "/home/wegscd/.virtualenvs/KivyTest/lib/python3.8/site-packages/kivy/app.py", line 954, in run
self._run_prepare()
File "/home/wegscd/.virtualenvs/KivyTest/lib/python3.8/site-packages/kivy/app.py", line 924, in _run_prepare
root = self.build()
File "/home/wegscd/PycharmProjects/KivyTest/main.py", line 204, in build
return MainWidget()
File "/home/wegscd/PycharmProjects/KivyTest/main.py", line 198, in __init__
if plyer.vibrator.exists():
File "/home/wegscd/.virtualenvs/KivyTest/lib/python3.8/site-packages/plyer/facades/vibrator.py", line 77, in exists
return self._exists()
File "/home/wegscd/.virtualenvs/KivyTest/lib/python3.8/site-packages/plyer/facades/vibrator.py", line 94, in _exists
raise NotImplementedError()
NotImplementedError
I would submit that it should just return False?
I am willing to write the implementation if the team is amenable to accepting it. I just tested this with plyer 2.1.0 and Kivy 2.1.0.
The text was updated successfully, but these errors were encountered:
Patch for 2.1.0 is attached; returns False for .exists() instead of raising NotImplementedError(). I don't have a patch for iOS; I don't understand how it's .exists() works.
I am writing a Kivy multiplatform app (Android and Linux). I am trying to deal with the possible lack of a vibrator by guarding the call to .vibrate() with an .exists() check.
plyer.vibrate.exists() currently throws a NotImplementedError on Linux.
I would submit that it should just return False?
I am willing to write the implementation if the team is amenable to accepting it. I just tested this with plyer 2.1.0 and Kivy 2.1.0.
The text was updated successfully, but these errors were encountered: