mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Removed oneliners
Oneline ifs are against pep8 and are a pain to read.
This commit is contained in:
parent
5df8ce36b7
commit
b2ae2c1ecf
@ -88,10 +88,12 @@ def export(data, filename=None):
|
|||||||
|
|
||||||
v = data['ship']['modules'][slot]
|
v = data['ship']['modules'][slot]
|
||||||
try:
|
try:
|
||||||
if not v: continue
|
if not v:
|
||||||
|
continue
|
||||||
|
|
||||||
module: __Module = outfitting.lookup(v['module'], ship_map)
|
module: __Module = outfitting.lookup(v['module'], ship_map)
|
||||||
if not module: continue
|
if not module:
|
||||||
|
continue
|
||||||
|
|
||||||
cr = class_rating(module)
|
cr = class_rating(module)
|
||||||
mods = v.get('modifications') or v.get('WorkInProgress_modifications') or {}
|
mods = v.get('modifications') or v.get('WorkInProgress_modifications') or {}
|
||||||
@ -129,10 +131,13 @@ def export(data, filename=None):
|
|||||||
print('EDShipyard: Unknown slot %s' % slot)
|
print('EDShipyard: Unknown slot %s' % slot)
|
||||||
|
|
||||||
except AssertionError as e:
|
except AssertionError as e:
|
||||||
if __debug__: print('EDShipyard: %s' % e)
|
if __debug__:
|
||||||
|
print('EDShipyard: %s' % e)
|
||||||
continue # Silently skip unrecognized modules
|
continue # Silently skip unrecognized modules
|
||||||
|
|
||||||
except:
|
except:
|
||||||
if __debug__: raise
|
if __debug__:
|
||||||
|
raise
|
||||||
|
|
||||||
# Construct description
|
# Construct description
|
||||||
ship = ship_map.get(data['ship']['name'].lower(), data['ship']['name'])
|
ship = ship_map.get(data['ship']['name'].lower(), data['ship']['name'])
|
||||||
@ -157,7 +162,8 @@ def export(data, filename=None):
|
|||||||
multiplier / (mass + fuel) + jumpboost,
|
multiplier / (mass + fuel) + jumpboost,
|
||||||
multiplier / (mass + fuel + cargo) + jumpboost)
|
multiplier / (mass + fuel + cargo) + jumpboost)
|
||||||
except:
|
except:
|
||||||
if __debug__: raise
|
if __debug__:
|
||||||
|
raise
|
||||||
|
|
||||||
if filename:
|
if filename:
|
||||||
with open(filename, 'wt') as h:
|
with open(filename, 'wt') as h:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user