mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-06 10:23:06 +03:00
Add extra logging to is_horizons() if things not as expected.
* Log the type(s) if not dict. * Log if ships['shipyard_list'] isn't present, despite ships being a dict.
This commit is contained in:
parent
98be182922
commit
173cffdcfc
@ -796,11 +796,23 @@ def is_horizons(economies: MAP_STR_ANY, modules: MAP_STR_ANY, ships: MAP_STR_ANY
|
|||||||
if isinstance(dict, economies):
|
if isinstance(dict, economies):
|
||||||
economies_colony = any(economy['name'] == 'Colony' for economy in economies.values())
|
economies_colony = any(economy['name'] == 'Colony' for economy in economies.values())
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.error(f'economies type is {type(economies)}')
|
||||||
|
|
||||||
if isinstance(dict, modules):
|
if isinstance(dict, modules):
|
||||||
modules_horizons = any(module.get('sku') == HORIZ_SKU for module in modules.values())
|
modules_horizons = any(module.get('sku') == HORIZ_SKU for module in modules.values())
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.error(f'modules type is {type(modules)}')
|
||||||
|
|
||||||
if isinstance(dict, ships):
|
if isinstance(dict, ships):
|
||||||
if ships.get('shipyard_list') is not None:
|
if ships.get('shipyard_list') is not None:
|
||||||
ship_horizons = any(ship.get('sku') == HORIZ_SKU for ship in ships['shipyard_list'].values())
|
ship_horizons = any(ship.get('sku') == HORIZ_SKU for ship in ships['shipyard_list'].values())
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.debug('No ships["shipyard_list"] - Damaged station or FC ?')
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.error(f'ships type is {type(ships)}')
|
||||||
|
|
||||||
return economies_colony or modules_horizons or ship_horizons
|
return economies_colony or modules_horizons or ship_horizons
|
||||||
|
Loading…
x
Reference in New Issue
Block a user