aboutsummaryrefslogtreecommitdiff
path: root/mu4web/components.py
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-08-07 12:49:54 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-08-07 15:16:41 +0200
commit0498331a15cfa8de7f2c3f4a761695ae21ae6245 (patch)
tree6c4a19fe4275a2b5a83fb9ec2da3648acb8a31ec /mu4web/components.py
parentStop reusing salt for passwords. (diff)
downloadmu4web-0498331a15cfa8de7f2c3f4a761695ae21ae6245.tar.gz
mu4web-0498331a15cfa8de7f2c3f4a761695ae21ae6245.tar.xz
Introduce dl function.
Diffstat (limited to 'mu4web/components.py')
-rw-r--r--mu4web/components.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mu4web/components.py b/mu4web/components.py
index e9701de..07ab400 100644
--- a/mu4web/components.py
+++ b/mu4web/components.py
@@ -9,6 +9,16 @@ from .html_render import HTML
from typing import cast, Optional
from urllib.parse import urlencode
from email.message import EmailMessage
+from typing import Iterable
+
+
+def dl(entries: Iterable[tuple[HTML, HTML]]) -> HTML:
+ """Build a description list."""
+ items = []
+ for k, v in entries:
+ items += [('dt', k),
+ ('dd', v)]
+ return ('dl', items)
def format_email(addr: Address) -> list[HTML]: