Merge branch 'release-final-python27' into python3

This commit is contained in:
Athanasius committed 2020-06-21 16:43:02 +01:00
commit 259bb3bbd6
11 files changed
+102 -13

No files matched your search

+3 -3
View File
@@ -396,8 +396,8 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
return filtered
# Track location
if entry['event'] in ['Location', 'FSDJump', 'Docked']:
if entry['event'] == 'Location':
if entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
if entry['event'] in ('Location', 'CarrierJump'):
this.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
elif entry['event'] == 'FSDJump':
this.planet = None
@@ -413,7 +413,7 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
# Send interesting events to EDDN, but not when on a crew
if (config.getint('output') & config.OUT_SYS_EDDN and not state['Captain'] and
(entry['event'] in ('Location', 'FSDJump', 'Docked', 'Scan', 'SAASignalsFound')) and
(entry['event'] in ('Location', 'FSDJump', 'Docked', 'Scan', 'SAASignalsFound', 'CarrierJump')) and
('StarPos' in entry or this.coordinates)):
# strip out properties disallowed by the schema
for thing in ['ActiveFine', 'CockpitBreach', 'BoostUsed', 'FuelLevel', 'FuelUsed', 'JumpDist', 'Latitude', 'Longitude', 'Wanted']:
+3 -3
View File
@@ -300,7 +300,7 @@ def worker():
plug.show_error(_('Error: EDSM {MSG}').format(MSG=msg))
else:
for e, r in zip(pending, reply['events']):
if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump']:
if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump', 'CarrierJump']:
# Update main window's system status
this.lastlookup = r
this.system.event_generate('<<EDSMStatus>>', when="tail") # calls update_status in main thread
@@ -347,13 +347,13 @@ def should_send(entries):
return False
# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event
# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event
def update_status(event=None):
for plugin in plug.provides('edsm_notify_system'):
plug.invoke(plugin, None, 'edsm_notify_system', this.lastlookup)
# Called with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event. https://www.edsm.net/en/api-journal-v1
# Called with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event. https://www.edsm.net/en/api-journal-v1
# msgnum: 1xx = OK, 2xx = fatal error, 3xx = error, 4xx = ignorable errors.
def edsm_notify_system(reply):
if not reply:
+21 -1
View File
@@ -377,6 +377,26 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
('minorfactionReputation', f['MyReputation']/100.0),
]) for f in entry['Factions']
])
elif entry['event'] == 'CarrierJump':
this.system = None
add_event('addCommanderTravelCarrierJump', entry['timestamp'],
OrderedDict([
('starsystemName', entry['StarSystem']),
('stationName', entry['StationName']),
('marketID', entry['MarketID']),
('shipType', state['ShipType']),
('shipGameID', state['ShipID']),
]))
if entry.get('Factions'):
add_event('setCommanderReputationMinorFaction', entry['timestamp'],
[
OrderedDict([
('minorfactionName', f['Name']),
('minorfactionReputation', f['MyReputation']/100.0),
]) for f in entry['Factions']
])
# Ignore the following 'Docked' event
this.suppress_docked = True
# Override standard URL functions
if config.get('system_provider') == 'Inara':
@@ -826,7 +846,7 @@ def worker():
print('Inara\t%s %s\t%s' % (reply_event['eventStatus'], reply_event.get('eventStatusText', ''), json.dumps(data_event)))
if reply_event['eventStatus'] // 100 != 2:
plug.show_error(_('Error: Inara {MSG}').format(MSG = '%s, %s' % (data_event['eventName'], reply_event.get('eventStatusText', reply_event['eventStatus']))))
if data_event['eventName'] in ['addCommanderTravelDock', 'addCommanderTravelFSDJump', 'setCommanderTravelLocation']:
if data_event['eventName'] in ['addCommanderTravelCarrierJump', 'addCommanderTravelDock', 'addCommanderTravelFSDJump', 'setCommanderTravelLocation']:
this.lastlocation = reply_event.get('eventData', {})
this.system_link.event_generate('<<InaraLocation>>', when="tail") # calls update_location in main thread
elif data_event['eventName'] in ['addCommanderShip', 'setCommanderShip']: