summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Buquet <pep@bouah.net>2020-06-24 18:46:37 +0200
committerMaxime Buquet <pep@bouah.net>2020-06-24 18:46:37 +0200
commit57cbbc1bde478fe18b6272430c88e57bbb12674e (patch)
tree4ce6b571b97a5a6d682bad9351418065f1ab3f3b
parentf9e2d24ee883d811b58a4aa2e1bb8a7e68ea350d (diff)
parent9b5ebbfd9c680c40c66f63ea4801e7f9065fdd4e (diff)
downloadpoezio-57cbbc1bde478fe18b6272430c88e57bbb12674e.tar.gz
poezio-57cbbc1bde478fe18b6272430c88e57bbb12674e.tar.bz2
poezio-57cbbc1bde478fe18b6272430c88e57bbb12674e.tar.xz
poezio-57cbbc1bde478fe18b6272430c88e57bbb12674e.zip
Merge branch 'reorder-gaptabs' into 'master'
Reorder gaptabs See merge request poezio/poezio!146
-rw-r--r--CHANGELOG9
-rw-r--r--plugins/reorder.py11
2 files changed, 16 insertions, 4 deletions
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
diff --git a/plugins/reorder.py b/plugins/reorder.py
index 01de5c5d..38975a02 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)
@@ -113,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