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
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
def test_is_file_exist(file_path):
    res = util.is_file_exist(file_path)
    print(res)
Пример #5
0
 def set_value(self):
     if util.is_file_exist(self.wallet_data):
         self.load()