From c5c4a6628f688a6a93dc57e33406f3aca8cce415 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Sat, 5 Aug 2023 21:00:30 +0200 Subject: [PATCH] Allow character ":" in tags. --- chatmastermind/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatmastermind/storage.py b/chatmastermind/storage.py index aa6288c..ac59eb5 100644 --- a/chatmastermind/storage.py +++ b/chatmastermind/storage.py @@ -7,7 +7,7 @@ from typing import List, Dict, Any, Optional def read_file(fname: pathlib.Path, tags_only: bool = False) -> Dict[str, Any]: with open(fname, "r") as fd: - tagline = fd.readline().strip().split(':')[1].strip() + tagline = fd.readline().strip().split(':', maxsplit=1)[1].strip() # also support tags separated by ',' (old format) separator = ',' if ',' in tagline else ' ' tags = [t.strip() for t in tagline.split(separator)]