You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# persist_session_fct is needed here, because the session may be updated if the access token expired, and thus this function will be called to save the new session
76
+
exceptExceptionas e:
77
+
print(f"Error trying to use stored tokens: {e}")
78
+
session =None
79
+
# Continue below with a regular log-in
80
+
73
81
ifnot session:
82
+
# 3b. Need to log-in interactively
74
83
username =None
75
84
password =None
76
85
otp_answer =None
@@ -95,10 +104,8 @@ class WSApiTest:
95
104
print("Login failed. Try again.")
96
105
username =None
97
106
password =None
98
-
99
-
# 3. Use the session object to instantiate the API object
# persist_session_fct is needed here too, because the session may be updated if the access token expired, and thus this function will be called to save the new session
107
+
# Use the new session object to instantiate the API object
# Optionally define functions to cache market data, if you want transactions' descriptions and accounts balances to show the security's symbol instead of its ID
0 commit comments