aboutsummaryrefslogtreecommitdiffstats
path: root/src/bbss/lists.py
diff options
context:
space:
mode:
authoralyx <alyx@aleteoryx.me>2023-11-25 22:31:49 -0500
committeralyx <alyx@aleteoryx.me>2023-11-25 22:31:49 -0500
commite21e42e832e4ac633a9d48f6e30c34a9011008bc (patch)
treea059574bd3fe1279e495ce0f8e2ac0810586184d /src/bbss/lists.py
parent646d743dce4a3704febfa28be3abce405823baef (diff)
downloadbbss.py-e21e42e832e4ac633a9d48f6e30c34a9011008bc.tar.gz
bbss.py-e21e42e832e4ac633a9d48f6e30c34a9011008bc.tar.bz2
bbss.py-e21e42e832e4ac633a9d48f6e30c34a9011008bc.zip
Main interface done. Up next: docs, logging, and polish
Diffstat (limited to 'src/bbss/lists.py')
-rw-r--r--src/bbss/lists.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bbss/lists.py b/src/bbss/lists.py
index ba6955a..5bcdddf 100644
--- a/src/bbss/lists.py
+++ b/src/bbss/lists.py
@@ -6,14 +6,14 @@ import requests
T = TypeVar('T')
def parse_listfile(contents: str, ctor: Callable[[str, Optional[str]], T]) -> List[T]:
acc = []
- comment_acc = ""
+ comment_acc = []
for line in contents.splitlines():
if line.startswith("#"):
continue
elif line.startswith("##"):
- comment_acc += line[2:].strip()
+ comment_acc.append(line[2:].strip())
else:
- acc.append(ctor(line, comment_acc if comment_acc else None))
+ acc.append(ctor(line, " ".join(comment_acc) if len(comment_acc) else None))
return acc
@dataclass(frozen=True)