def setup(self): self.controller = App.get_running_app().controller self.keystore_path = Settings.get_keystore_path() accounts = self.controller.pywalib.get_account_list() if len(accounts) == 0: title = "No keystore found." body = "Import or create one." dialog = Dialog.create_dialog(title, body) dialog.open()
def pywalib(self): """ Gets or creates the PyWalib object. Also recreates the object if the keystore_path changed. """ keystore_path = Settings.get_keystore_path() chain_id = Settings.get_stored_network() if self._pywalib is None or \ self._pywalib.keystore_dir != keystore_path or \ self._pywalib.chain_id != chain_id: self._pywalib = PyWalib( keystore_dir=keystore_path, chain_id=chain_id) return self._pywalib