From 6bde36ad312b8a99cc8d639a14aaea470971ced0 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 17 Mar 2021 11:26:34 +0000 Subject: [PATCH 1/2] Extend is_horizons() paranoia to type of ships['shipyard_list'] The .values() is on this, so it also needs to be a dict. I also made the logging of "FC or Damaged Station?" consistent throughout this file. Yes, we'll keep these as logger.debug() for now. --- plugins/eddn.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index a8a34b48..1197b628 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -288,7 +288,7 @@ Msg:\n{msg}''' logger.debug('modules was None. FC or Damaged Station?') elif isinstance(modules, list): if len(modules) == 0: - logger.debug('modules is empty list. Damaged Station?') + logger.debug('modules is empty list. FC or Damaged Station?') else: logger.error(f'modules is non-empty list: {modules!r}') else: @@ -807,10 +807,14 @@ def is_horizons(economies: MAP_STR_ANY, modules: MAP_STR_ANY, ships: MAP_STR_ANY if isinstance(ships, dict): if ships.get('shipyard_list') is not None: - ship_horizons = any(ship.get('sku') == HORIZ_SKU for ship in ships['shipyard_list'].values()) + if isinstance(ships.get('shipyard_list'), dict): + ship_horizons = any(ship.get('sku') == HORIZ_SKU for ship in ships['shipyard_list'].values()) + + else: + logger.debug('ships["shipyard_list"] is not dict - FC or Damaged Station?') else: - logger.debug('No ships["shipyard_list"] - Damaged station or FC ?') + logger.debug('ships["shipyard_list"] is None - FC or Damaged Station?') else: logger.error(f'ships type is {type(ships)}') From aff1cfa6c847953521e0f5dad17ca22ba5f505db Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 17 Mar 2021 12:08:50 +0000 Subject: [PATCH 2/2] Release 4.2.2: appversion and changelog --- ChangeLog.md | 10 ++++++++++ config.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 25fc8188..ae45fc74 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,16 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in reverse chronological order (latest first). --- +Release 4.2.2 +=== + + This release contains a minor bug-fix, actually properly checking a station's +ships list before operating on it. + +* Check that `ships['shipuard_list']` is a `dict` before trying to use + `.values()` on it. This fixes the issue with seeing `list object has no + attribute values` in the application status line. + Release 4.2.1 === diff --git a/config.py b/config.py index f611043f..1c660ac7 100644 --- a/config.py +++ b/config.py @@ -13,7 +13,7 @@ appcmdname = 'EDMC' # appversion **MUST** follow Semantic Versioning rules: # # Major.Minor.Patch(-prerelease)(+buildmetadata) -appversion = '4.2.1' #-rc1+a872b5f' +appversion = '4.2.2' #-rc1+a872b5f' # For some things we want appversion without (possible) +build metadata appversion_nobuild = str(semantic_version.Version(appversion).truncate('prerelease')) copyright = u'© 2015-2019 Jonathan Harris, 2020 EDCD'