2022-09-16 10:07:57 -06:00
|
|
|
try:
|
|
|
|
import keyring
|
|
|
|
except ImportError:
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
2024-06-02 10:31:58 -06:00
|
|
|
from sbapp.plyer.facades import Keystore
|
2022-09-16 10:07:57 -06:00
|
|
|
|
|
|
|
|
|
|
|
class OSXKeystore(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 OSXKeystore()
|