import sys import ustruct # mock implementation using binary file _mock = {} if sys.platform in ['trezor', 'pyboard']: # stmhal _file = '/flash/trezor.config' else: _file = '/var/tmp/trezor.config' def _load(): global _mock try: with open(_file, 'rb') as f: while True: d = f.read(4) if len(d) != 4: break k, l = ustruct.unpack('