This repository has been archived on 2019-12-04. You can view files and clone it, but cannot push or open issues or pull requests.
elite_api/companion.py

26 lines
691 B
Python

from edmc import companion as c
import platform
companion_session = c.Session()
if platform.system() == 'Windows':
import easygui
import os
import requests.certs
os.environ['REQUESTS_CA_BUNDLE'] = requests.certs.where()
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()