From e7b74c19a8954ebb6bb3315fe2a403f490f0b5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 15 Jun 2020 16:04:37 +0200 Subject: plugins/reorder: Ignore gaptab when parsing as they're recreated automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/reorder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/reorder.py b/plugins/reorder.py index 01de5c5d..4a5f515e 100644 --- a/plugins/reorder.py +++ b/plugins/reorder.py @@ -92,7 +92,11 @@ def parse_config(tab_config): if pos in result or pos <= 0: return None - typ, name = tab_config.get(option, default=':').split(':', maxsplit=1) + spec = tab_config.get(option, default=':').split(':', maxsplit=1) + # Gap tabs are recreated automatically if there's a gap in indices. + if spec == 'empty': + return None + typ, name = spec if typ not in TEXT_TO_TAB: return None result[pos] = (TEXT_TO_TAB[typ], name) -- cgit v1.2.3 From 75d7f5da9368f6ce6947aa5a1728f94eb149d4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 15 Jun 2020 16:06:48 +0200 Subject: plugins/reorder: Don't serialize gaptabs as they're recreated automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/reorder.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/reorder.py b/plugins/reorder.py index 4a5f515e..38975a02 100644 --- a/plugins/reorder.py +++ b/plugins/reorder.py @@ -117,9 +117,8 @@ def parse_runtime_tablist(tablist): for tab in tablist[1:]: i += 1 result = check_tab(tab) - if result == 'empty': - props.append((i, 'empty')) - elif result: + # Don't serialize gap tabs as they're recreated automatically + if result != 'empty': props.append((i, '%s:%s' % (result, tab.jid.full))) return props -- cgit v1.2.3 From 9b5ebbfd9c680c40c66f63ea4801e7f9065fdd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 15 Jun 2020 16:35:03 +0200 Subject: plugins/reorder: update changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- CHANGELOG | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d2a7691d..adcab884 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,15 @@ https://dev.louiz.org/projects/poezio/roadmap * Poezio 0.14 - dev +# Minor Changes + +- Reorder: Prevent GapTabs from being serialized and ignore when serialized as + they're recreated automatically. + +# Bug fixes + +- Reorder: Fix traceback on serialized gap tabs. + * Poezio 0.13.1 # Bug fixes -- cgit v1.2.3