25 lines
662 B
Python
25 lines
662 B
Python
import easygui
|
|
from edmc import companion as c
|
|
import os
|
|
import platform
|
|
|
|
if platform.system() == 'Windows':
|
|
os.environ['REQUESTS_CA_BUNDLE'] = "requests/cacert.pem"
|
|
|
|
companion_session = c.Session()
|
|
|
|
def login(username, password):
|
|
try:
|
|
companion_session.login(username, password)
|
|
except c.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()
|