def update_inara(inara_session): data = companion.get_data() assets = inara_session.update_credits(data['commander']['credits']) inara_session.update_location(data['lastSystem']['name']) return { 'cmdr': data['commander']['name'], 'location': data['lastSystem']['name'], 'credits': data['commander']['credits'], 'assets': assets, 'ship_id': data['ship']['id'], }
def main(): settings = utils.get_settings(use_gui=False) flags = flag_parser.parse_args() companion.login(settings.get("ed_companion", "username"), settings.get("ed_companion", "password")) data = companion.get_data() # Now we have the data! if flags.dump: pprint(data) else: print "Commander %s" % data["commander"]["name"] print "Credits: %s" % data["commander"]["credits"] print "Location: %s" % data["lastSystem"]["name"]
def main(): settings = utils.get_settings(use_gui=False) flags = flag_parser.parse_args() companion.login(settings.get('ed_companion', 'username'), settings.get('ed_companion', 'password')) data = companion.get_data() # Now we have the data! if flags.dump: pprint(data) else: print "Commander %s" % data['commander']['name'] print "Credits: %s" % data['commander']['credits'] print "Location: %s" % data['lastSystem']['name']