1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-07-07 04:08:56 +03:00

Aligned values of large dicts

helps your eyes track the changes
This commit is contained in:
A_D 2020-07-19 19:08:36 +02:00 committed by Athanasius
parent ed45d59af1
commit b010b8015d

@ -90,29 +90,29 @@ class EDLogs(FileSystemEventHandler):
# Cmdr state shared with EDSM and plugins # Cmdr state shared with EDSM and plugins
# If you change anything here update PLUGINS.md documentation! # If you change anything here update PLUGINS.md documentation!
self.state = { self.state = {
'Captain': None, # On a crew 'Captain': None, # On a crew
'Cargo': defaultdict(int), 'Cargo': defaultdict(int),
'Credits': None, 'Credits': None,
'FID': None, # Frontier Cmdr ID 'FID': None, # Frontier Cmdr ID
'Horizons': None, # Does this user have Horizons? 'Horizons': None, # Does this user have Horizons?
'Loan': None, 'Loan': None,
'Raw': defaultdict(int), 'Raw': defaultdict(int),
'Manufactured': defaultdict(int), 'Manufactured': defaultdict(int),
'Encoded': defaultdict(int), 'Encoded': defaultdict(int),
'Engineers': {}, 'Engineers': {},
'Rank': {}, 'Rank': {},
'Reputation': {}, 'Reputation': {},
'Statistics': {}, 'Statistics': {},
'Role': None, # Crew role - None, Idle, FireCon, FighterCon 'Role': None, # Crew role - None, Idle, FireCon, FighterCon
'Friends': set(), # Online friends 'Friends': set(), # Online friends
'ShipID': None, 'ShipID': None,
'ShipIdent': None, 'ShipIdent': None,
'ShipName': None, 'ShipName': None,
'ShipType': None, 'ShipType': None,
'HullValue': None, 'HullValue': None,
'ModulesValue': None, 'ModulesValue': None,
'Rebuy': None, 'Rebuy': None,
'Modules': None, 'Modules': None,
} }
def start(self, root): def start(self, root):
@ -363,29 +363,29 @@ class EDLogs(FileSystemEventHandler):
self.systemaddress = None self.systemaddress = None
self.started = None self.started = None
self.state = { self.state = {
'Captain': None, 'Captain': None,
'Cargo': defaultdict(int), 'Cargo': defaultdict(int),
'Credits': None, 'Credits': None,
'FID': None, 'FID': None,
'Horizons': None, 'Horizons': None,
'Loan': None, 'Loan': None,
'Raw': defaultdict(int), 'Raw': defaultdict(int),
'Manufactured': defaultdict(int), 'Manufactured': defaultdict(int),
'Encoded': defaultdict(int), 'Encoded': defaultdict(int),
'Engineers': {}, 'Engineers': {},
'Rank': {}, 'Rank': {},
'Reputation': {}, 'Reputation': {},
'Statistics': {}, 'Statistics': {},
'Role': None, 'Role': None,
'Friends': set(), 'Friends': set(),
'ShipID': None, 'ShipID': None,
'ShipIdent': None, 'ShipIdent': None,
'ShipName': None, 'ShipName': None,
'ShipType': None, 'ShipType': None,
'HullValue': None, 'HullValue': None,
'ModulesValue': None, 'ModulesValue': None,
'Rebuy': None, 'Rebuy': None,
'Modules': None, 'Modules': None,
} }
elif entry['event'] == 'Commander': elif entry['event'] == 'Commander':
@ -868,7 +868,8 @@ class EDLogs(FileSystemEventHandler):
for slot in sorted( for slot in sorted(
self.state['Modules'], self.state['Modules'],
key=lambda x: ( key=lambda x: (
'Hardpoint' not in x, x not in standard_order and len(standard_order) or standard_order.index(x), 'Hardpoint' not in x,
x not in standard_order and len(standard_order) or standard_order.index(x),
'Slot' not in x, x) 'Slot' not in x, x)
): ):