diff options
author | alyx <alyx@aleteoryx.me> | 2023-12-24 17:12:56 -0500 |
---|---|---|
committer | alyx <alyx@aleteoryx.me> | 2023-12-24 17:12:56 -0500 |
commit | defde6070677e806c40d5891543848fcb2001ef5 (patch) | |
tree | 20a0a3976a0c7b522aef35d4298dcd951bed4b99 /src/bbss | |
parent | 48f62aba8db8efe3a109837cda52d04b1b9aad5b (diff) | |
download | bbss.py-defde6070677e806c40d5891543848fcb2001ef5.tar.gz bbss.py-defde6070677e806c40d5891543848fcb2001ef5.tar.bz2 bbss.py-defde6070677e806c40d5891543848fcb2001ef5.zip |
bbss.lists documented, doctests setup
Diffstat (limited to 'src/bbss')
-rw-r--r-- | src/bbss/lists.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |