openCom-Companion/sbapp/plyer/platforms/linux/keystore.py

20 lines
430 B
Python
Raw Permalink Normal View History

2022-09-16 18:07:57 +02:00
try:
import keyring
except ImportError:
raise NotImplementedError()
from plyer.facades import Keystore
class LinuxKeystore(Keystore):
def _set_key(self, servicename, key, value, **kwargs):
keyring.set_password(servicename, key, value)
def _get_key(self, servicename, key, **kwargs):
return keyring.get_password(servicename, key)
def instance():
return LinuxKeystore()