Allow character ":" in tags.

This commit is contained in:
OK 2023-08-05 21:00:30 +02:00
parent f8ed0e3636
commit c5c4a6628f

View File

@ -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)]