1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

add default value to trezor.storage.get

This commit is contained in:
Pavol Rusnak 2016-05-21 12:51:43 +02:00
parent ddf6771981
commit 9ed3b24edf
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 4 additions and 4 deletions

View File

@ -27,10 +27,10 @@ STATIC mp_obj_t mod_TrezorStorage_Storage_make_new(const mp_obj_type_t *type, si
return MP_OBJ_FROM_PTR(o);
}
STATIC mp_obj_t mod_TrezorStorage_Storage_get(mp_obj_t self, mp_obj_t name) {
STATIC mp_obj_t mod_TrezorStorage_Storage_get(mp_obj_t self, mp_obj_t name, mp_obj_t defval) {
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorStorage_Storage_get_obj, mod_TrezorStorage_Storage_get);
STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorStorage_Storage_get_obj, mod_TrezorStorage_Storage_get);
STATIC mp_obj_t mod_TrezorStorage_Storage_set(mp_obj_t self, mp_obj_t name, mp_obj_t value) {
return mp_const_none;

View File

@ -3,8 +3,8 @@ from TrezorStorage import Storage
_storage = Storage()
def get(name):
return _storage.get(name)
def get(name, defval=None):
return _storage.get(name, defval)
def set(name, value):