Add companion API.
This commit is contained in:
parent
207bab7175
commit
0654796a1a
20
companion.py
Normal file
20
companion.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from edmc import companion as c
|
||||
import platform
|
||||
import easygui
|
||||
|
||||
companion_session = companion.Session()
|
||||
|
||||
def login(username, password):
|
||||
try:
|
||||
companion_session.login(username, password)
|
||||
except companion.VerificationRequired:
|
||||
if platform.system() == 'Windows':
|
||||
code = easygui.enterbox("Input Verification Code (check your email)",
|
||||
"Verification Required")
|
||||
else:
|
||||
code = raw_input("Input Verification Code (check your email): ")
|
||||
companion_session.verify(code)
|
||||
|
||||
|
||||
def get_data():
|
||||
return companion_session.query()
|
Reference in New Issue
Block a user