From defde6070677e806c40d5891543848fcb2001ef5 Mon Sep 17 00:00:00 2001 From: alyx Date: Sun, 24 Dec 2023 17:12:56 -0500 Subject: bbss.lists documented, doctests setup --- src/bbss/lists.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bbss/lists.py b/src/bbss/lists.py index 5bcdddf..6fa757f 100644 --- a/src/bbss/lists.py +++ b/src/bbss/lists.py @@ -8,12 +8,15 @@ def parse_listfile(contents: str, ctor: Callable[[str, Optional[str]], T]) -> Li acc = [] comment_acc = [] for line in contents.splitlines(): - if line.startswith("#"): + if not len(line): continue elif line.startswith("##"): comment_acc.append(line[2:].strip()) + elif line.startswith("#"): + continue else: acc.append(ctor(line, " ".join(comment_acc) if len(comment_acc) else None)) + comment_acc = [] return acc @dataclass(frozen=True) -- cgit v1.2.3-54-g00ecf