Commit f8d4a5af authored by Bram Schoenmakers's avatar Bram Schoenmakers

Deduplicate alphabet, but preserve order as it appears in the configuration

parent 1d333708
...@@ -20,6 +20,7 @@ import os ...@@ -20,6 +20,7 @@ import os
import re import re
import shlex import shlex
from collections import OrderedDict
from itertools import accumulate from itertools import accumulate
from string import ascii_lowercase from string import ascii_lowercase
...@@ -478,8 +479,9 @@ class _Config: ...@@ -478,8 +479,9 @@ class _Config:
def identifier_alphabet(self): def identifier_alphabet(self):
alphabet = self.cp.get('topydo', 'identifier_alphabet') alphabet = self.cp.get('topydo', 'identifier_alphabet')
# deduplicate characters alphabet # deduplicate characters alphabet. Use a dictionary, but an ordered one
return list({c: None for c in alphabet}.keys()) # to keep determinism.
return list(OrderedDict([(c, None) for c in alphabet]).keys())
def config(p_path=None, p_overrides=None): def config(p_path=None, p_overrides=None):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment