This repository has been archived on 2025-07-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
inara_updater/actions.py
2016-01-28 11:52:23 -05:00

18 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'])