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.
inara_updater/actions.py
2016-01-28 11:52:23 -05:00

19 lines
616 B
Python

"""
This module mostly serves as a shim between the elite_api library and the rest of our program.
"""
from elite_api import companion
from elite_api.inara import InaraSession
def do_logins(settings):
inara_session = InaraSession(settings.get('inara', 'username'), settings.get('inara', 'password'))
companion.login(settings.get('ed_companion', 'username'), settings.get('ed_companion', 'password'))
return inara_session
def update_inara(inara_session):
data = companion.get_data()
inara_session.update_credits(data['commander']['credits'])
inara_session.update_location(data['lastSystem']['name'])