# standard imports import stat import os import logging # external imports from funga.eth.keystore.dict import DictKeystore from funga.eth.signer import EIP155Signer # local imports from cic.keystore import KeystoreDirectory logg = logging.getLogger(__name__) class EthKeystoreDirectory(DictKeystore, KeystoreDirectory): pass def parse_signer(signer_hint): if signer_hint == None: logg.info('signer hint missing') return None st = os.stat(signer_hint) if stat.S_ISDIR(st.st_mode): logg.debug('signer hint is directory') keystore = EthKeystoreDirectory() keystore.process_dir(signer_hint) signer = EIP155Signer(keystore) return signer