def open_wallet(self, wallet_path: str): self.wallet_path = wallet_path if is_file_exist(wallet_path) is False: # create a new wallet file self.wallet_in_mem.create_time = datetime.today().strftime("%Y-%m-%d %H:%M:%S") self.save() # wallet file exists now self.wallet_file = self.load() self.wallet_in_mem = self.wallet_file return self.wallet_file
def create_wallet(self, wallet_file): if util.is_file_exist(wallet_file): raise IsADirectoryError("wallet file has already exist") return client.open(wallet_file)
def open_or_create_wallet(self, wallet_file): if util.is_file_exist(wallet_file): return self.open_wallet(wallet_file) return self.create_wallet(wallet_file)
def test_is_file_exist(file_path): res = util.is_file_exist(file_path) print(res)
def set_value(self): if util.is_file_exist(self.wallet_data): self.load()