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/update_inara.py

23 lines
628 B
Python
Raw Normal View History

2015-10-26 00:51:48 +00:00
#!/usr/bin/python
2016-01-21 19:42:54 +00:00
from elite_api import companion
from elite_api.inara import InaraSession
2015-10-26 00:51:48 +00:00
import utils
2016-01-22 04:16:04 +00:00
if utils.windows_detected():
import easygui
2015-10-26 00:51:48 +00:00
settings = utils.get_settings()
inara_session = InaraSession(settings.get('inara', 'username'), settings.get('inara', 'password'))
2015-10-26 00:51:48 +00:00
2016-01-21 19:42:54 +00:00
companion.login(settings.get('ed_companion', 'username'), settings.get('ed_companion', 'password'))
data = companion.get_data()
inara_session.update_credits(data['commander']['credits'])
inara_session.update_location(data['lastSystem']['name'])
2015-10-26 00:51:48 +00:00
if utils.windows_detected():
easygui.msgbox("Inara updated!")
else:
print("Inara updated!")