mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 09:57:40 +03:00
eddn: journal: Make SystemAddress
a check, not an augmentation
On checking, all of the events valid for the journal schema (and CodexEntry has its own schema and separate EDMC code) already contain SystemAddress, so it would never be added as an augmentation. Instead, turn this into a sanity check.
This commit is contained in:
parent
4a207429cd
commit
4fcd2ae3f3
@ -1697,6 +1697,7 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
# The generic journal schema is for events:
|
# The generic journal schema is for events:
|
||||||
# Docked, FSDJump, Scan, Location, SAASignalsFound, CarrierJump
|
# Docked, FSDJump, Scan, Location, SAASignalsFound, CarrierJump
|
||||||
# (Also CodexEntry, but that has its own schema and handling).
|
# (Also CodexEntry, but that has its own schema and handling).
|
||||||
|
# Journals 2021-08-23 to 2022-05-29
|
||||||
# StarSystem SystemAddress StarPos
|
# StarSystem SystemAddress StarPos
|
||||||
# Docked Y Y N
|
# Docked Y Y N
|
||||||
# FSDJump Y Y Y
|
# FSDJump Y Y Y
|
||||||
@ -1704,7 +1705,12 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
# Location Y Y Y
|
# Location Y Y Y
|
||||||
# SAASignalsFound N Y N
|
# SAASignalsFound N Y N
|
||||||
# CarrierJump Y Y Y
|
# CarrierJump Y Y Y
|
||||||
# add mandatory StarSystem, StarPos and SystemAddress properties to Scan events
|
|
||||||
|
if 'SystemAddress' not in entry:
|
||||||
|
logger.warning("journal schema event doesn't contain SystemAddress when it should, aborting")
|
||||||
|
return "No SystemAddress in event, aborting send"
|
||||||
|
|
||||||
|
# add mandatory StarSystem and StarPos properties to events
|
||||||
if 'StarSystem' not in entry:
|
if 'StarSystem' not in entry:
|
||||||
if not system:
|
if not system:
|
||||||
logger.warning("system is falsey, can't add StarSystem")
|
logger.warning("system is falsey, can't add StarSystem")
|
||||||
@ -1725,13 +1731,6 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
|
|
||||||
entry['StarPos'] = list(this.coordinates)
|
entry['StarPos'] = list(this.coordinates)
|
||||||
|
|
||||||
if 'SystemAddress' not in entry:
|
|
||||||
if not this.systemaddress:
|
|
||||||
logger.warning("this.systemaddress is falsey, can't add SystemAddress")
|
|
||||||
return "this.systemaddress is falsey, can't add SystemAddress"
|
|
||||||
|
|
||||||
entry['SystemAddress'] = this.systemaddress
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
this.eddn.export_journal_generic(cmdr, is_beta, filter_localised(entry))
|
this.eddn.export_journal_generic(cmdr, is_beta, filter_localised(entry))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user