Commit 5e7efd6c authored by Fluffy Witch's avatar Fluffy Witch

Modifications du main.py et Const.py

Il y avait quelques bugs, qui devraient être corrigés maintenant.
parent ad422609
......@@ -2,7 +2,7 @@ debug = False
debugOutput = "data/debugOutput.txt"
debugInput = "data/debugInput.txt"
debugStatus = "data/statusDebug"
appName = "myTextAdventureApp"
appName = "textAdventureFluffy"
......
......@@ -37,6 +37,7 @@ if(not os.path.exists(Consts.appCred) or not os.path.exists(Consts.apiBaseURLFil
Log.logprint("The url of the mastodon instance needs to start with either https:// or http://")
sys.exit(1)
else:
#We create the app.
Mastodon.create_app(
Consts.appName,
......@@ -44,7 +45,7 @@ if(not os.path.exists(Consts.appCred) or not os.path.exists(Consts.apiBaseURLFil
to_file=Consts.appCred
)
#We save the api_base_url in a file
with open(Consts.apiBaseURL, "w+") as apiFile:
with open(Consts.apiBaseURLFile, "w+") as apiFile:
apiFile.write(api_base_url)
Log.logprint("\nGreat !")
......@@ -59,10 +60,12 @@ if(not os.path.exists(Consts.accountCred)):
account_password = "1"
account_password2 = "2"
while(account_password is not account_password2):
while(account_password != account_password2):
account_password = getpass("Bot password (it won't be stored): ").strip()
account_password2 = getpass("Confirm Bot password : ").strip()
if(account_password is not account_password2):
if(account_password != account_password2):
Log.logprint(account_password)
Log.logprint(account_password2)
Log.logprint("The passwords are different. Try again.\n")
......@@ -98,6 +101,8 @@ if(not os.path.exists(Consts.emergencyContactFile) and Consts.proposeEmergencyCo
if(emergency_contact is "none"):
tryFind = False
else:
# TODO : apiMasto doesn't work fine
break
api_base_url = open(Consts.apiBaseURLFile).read()
apiMasto = mastodon.Mastodon(client_id = Consts.appCred, access_token = Consts.accountCred,api_base_url = api_base_url)
res = apiMasto.account_search(emergency_contact)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment