1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-12 08:20:56 +00:00
trezor-firmware/src/trezor/config.py

26 lines
467 B
Python
Raw Normal View History

2016-05-23 14:05:52 +00:00
# mock in-memory implementation
_mock = {}
def get(app, key, default=None):
return _mock.get((app << 8) | key, default)
def set(app, key, value):
_mock[(app << 8) | key] = value
return True
# real implementation commented below
'''
2016-05-23 13:44:09 +00:00
from TrezorConfig import Config
_config = Config()
def get(app, key, default=None):
v = _config.get(app, key)
return v if v else default
def set(app, key, value):
return _config.set(app, key, value)
2016-05-23 14:05:52 +00:00
'''