Enforce strict typing

This commit is contained in:
Mike A
2024-01-01 21:47:06 +01:00
parent d989af9243
commit 1b18e0dfef
10 changed files with 604 additions and 204 deletions

View File

@@ -2,8 +2,13 @@ import json
import logging
import os
from findmy import AppleAccount, LoginState, SmsSecondFactor, RemoteAnisetteProvider
from findmy import keys
from findmy import (
AppleAccount,
LoginState,
RemoteAnisetteProvider,
SmsSecondFactor,
keys,
)
# URL to (public or local) anisette server
ANISETTE_SERVER = "http://localhost:6969"
@@ -50,7 +55,7 @@ def fetch_reports(lookup_key):
# Save / restore account logic
if os.path.isfile("account.json"):
with open("account.json", "r") as f:
with open("account.json") as f:
acc.restore(json.load(f))
else:
login(acc)

View File

@@ -6,10 +6,10 @@ import os
from findmy import (
AsyncAppleAccount,
LoginState,
SmsSecondFactor,
RemoteAnisetteProvider,
SmsSecondFactor,
keys,
)
from findmy import keys
# URL to (public or local) anisette server
ANISETTE_SERVER = "http://localhost:6969"
@@ -57,7 +57,7 @@ async def fetch_reports(lookup_key):
try:
# Save / restore account logic
if os.path.isfile("account.json"):
with open("account.json", "r") as f:
with open("account.json") as f:
acc.restore(json.load(f))
else:
await login(acc)