mirror of
https://github.com/malmeloo/FindMy.py.git
synced 2026-04-17 21:53:57 +02:00
Enforce strict typing
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user