diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-11-20 14:59:34 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-11-20 14:59:34 +0100 |
commit | 2b6c9088c78d1aa944eeb969f678d644b8ef1180 (patch) | |
tree | 294a983822471a2d65581fdf945b457fc724cb3f /alot/utils/collections.py | |
parent | d64e41150f6ba53a9361e8560d374bc69974ca84 (diff) |
commands/envelope: refactor deriving headers to be edited
Split the code into its own function.
Make it properly case-insensitive.
Apply either the blacklist or the whitelist setting, trying to apply
both makes no sense.
Enforce that either a blacklist or a whitelist is configured in the
settings.
Diffstat (limited to 'alot/utils/collections.py')
-rw-r--r-- | alot/utils/collections.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/alot/utils/collections.py b/alot/utils/collections.py deleted file mode 100644 index acde56ce..00000000 --- a/alot/utils/collections.py +++ /dev/null @@ -1,29 +0,0 @@ -# This file is released under the GNU GPL, version 3 or a later revision. -# For further details see the COPYING file - -from collections.abc import Set - -# for backward compatibility with Python <3.7 -from collections import OrderedDict - - -class OrderedSet(Set): - """ - Ordered collection of distinct hashable objects. - Taken from https://stackoverflow.com/a/10006674 - """ - - def __init__(self, iterable=()): - self.d = OrderedDict.fromkeys(iterable) - - def __len__(self): - return len(self.d) - - def __contains__(self, element): - return element in self.d - - def __iter__(self): - return iter(self.d) - - def __repr__(self): - return str(list(self)) |