diff options
author | Devaev Maxim <[email protected]> | 2020-11-22 14:33:18 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-11-22 14:33:18 +0300 |
commit | b7e0ee3300ddca0b4c7049ee9bfb172996b56ff2 (patch) | |
tree | d5ac6caf34cf0eeef3e464b7f1102cc8e3ddf469 /kvmd/tools.py | |
parent | d8a631ab84de53ad387c452f55b6060bcc2300c0 (diff) | |
parent | 48550d2e78acb7e2669f8bd9595330c4001302f1 (diff) |
Merge branch 'multihid'
Diffstat (limited to 'kvmd/tools.py')
-rw-r--r-- | kvmd/tools.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kvmd/tools.py b/kvmd/tools.py index 555ddc3e..40db9b9c 100644 --- a/kvmd/tools.py +++ b/kvmd/tools.py @@ -57,6 +57,10 @@ def sorted_kvs(dct: Dict[_DictKeyT, _DictValueT]) -> List[Tuple[_DictKeyT, _Dict return sorted(dct.items(), key=operator.itemgetter(0)) +def swapped_kvs(dct: Dict[_DictKeyT, _DictValueT]) -> Dict[_DictValueT, _DictKeyT]: + return {value: key for (key, value) in dct.items()} + + # ===== def clear_queue(q: multiprocessing.queues.Queue) -> None: # pylint: disable=invalid-name for _ in range(q.qsize()): |