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

Replaced or magic with multiline if

Abusing ors for that is incredibly confusing.
Additionally, I replaced the .join() call with a static .format call, as
the join is confusing for no reason
This commit is contained in:
A_D 2020-07-10 05:46:22 +02:00
parent 82fce9e8c0
commit 87ad0f3080
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -149,7 +149,14 @@ def export(data, filename=None):
# Construct description
ship = ship_map.get(data['ship']['name'].lower(), data['ship']['name'])
string = '[%s]\n' % (data['ship'].get('shipName') and ', '.join([ship, data['ship']['shipName']]) or ship)
if data['ship'].get('shipName') is not None:
_ships = '{}, {}'.format(ship, data['ship']['shipName'])
else:
_ships = ship
string = '[{}]\n'.format(_ships)
for slot in ['H', 'L', 'M', 'S', 'U', None, 'BH', 'RB', 'TM', 'FH', 'EC', 'PC', 'SS', 'FS', None, 'MC', None, '9', '8', '7', '6', '5', '4', '3', '2', '1']:
if not slot:
string += '\n'