Skip to content

Commit

Permalink
fix: 🐛 Fix the init part of User class
Browse files Browse the repository at this point in the history
  • Loading branch information
Alndaly committed Jul 22, 2023
1 parent ba66449 commit a4fc954
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/quafu/users/userapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ class User(object):
def __init__(self):
self.apitoken = ""
self._url = "http://quafu.baqis.ac.cn/"
self.load_account()


if(self.check_account_data()):
self.load_account()

self.backends_api = "qbackend/get_backends/"
self.chip_api = "qbackend/scq_get_chip_info/"
self.exec_api = "qbackend/scq_kit/"
self.exec_async_api = "qbackend/scq_kit_asyc/"
self.exec_recall_api = "qbackend/scq_task_recall/"
self.priority = 2

def check_account_data(self):
homedir = get_homedir()
file_dir = homedir + "/.quafu/"
if not os.path.exists(file_dir):
print("Your user information is not configured. Remember to configure it by User.save_apitoken(<your api_token>)")
return False
return True
# TODO: Check if the user's basic data file is formated

def save_apitoken(self, apitoken):
"""
Expand Down

0 comments on commit a4fc954

Please sign in to comment.