summaryrefslogtreecommitdiff
path: root/jimbrella/utils.py
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-02-02 11:15:09 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-02-02 11:15:09 +0800
commit66264fe5730943576b847077dadf5e4531d4beb1 (patch)
treedb4b4d1dddd5cd6604e96715bf5c5e0d14fa35ac /jimbrella/utils.py
parent02547e6078a7cd6c1371379f1bab72bf48add23d (diff)
Adapt core to new db
Diffstat (limited to 'jimbrella/utils.py')
-rw-r--r--jimbrella/utils.py11
1 files changed, 0 insertions, 11 deletions
diff --git a/jimbrella/utils.py b/jimbrella/utils.py
index 31fafbc..fd2c86d 100644
--- a/jimbrella/utils.py
+++ b/jimbrella/utils.py
@@ -19,14 +19,3 @@ def human_timedelta(delta: timedelta) -> str:
hours = delta.seconds // 3600
minutes = (delta.seconds - (hours * 3600)) // 60
return days + f"{hours:0>2}:{minutes:0>2}" # zero-pad to two digits
-
-
-def group_by_key(data: list, key: str) -> dict:
- """Groups a list of dicts by the value of their `key` into a dict of lists of dicts."""
- keys = set([item[key] for item in data])
- # initiate a dict with `keys` as keys and [] as values
- groups = dict.fromkeys(keys, [])
- for k in keys:
- groups[k] = [item for item in data if item[key] == k]
-
- return groups