1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 08:40:34 +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

View File

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