From bc3ccff1477b1b0ba686d0c5b92aff52075b31fa Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <alexander.schlemmer@ds.mpg.de> Date: Sun, 19 May 2019 11:13:02 +0200 Subject: [PATCH] added doc and support for simple persons --- src/caosadvancedtools/read_md_header.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/caosadvancedtools/read_md_header.py b/src/caosadvancedtools/read_md_header.py index 7ff7d6b9..82d0077f 100644 --- a/src/caosadvancedtools/read_md_header.py +++ b/src/caosadvancedtools/read_md_header.py @@ -199,7 +199,18 @@ def _add_header(filename): def parse_responsibles(header): + """ + Extract the responsible person(s) from the yaml header. + + If field responsible is a list every entry from that list will be added as a person. + Currently only the format <Firstname> <Lastname> <*> is supported. + If it is a simple string, it is added as the only person. + """ people = [] + if type(header["responsible"]) == list: + resplist = header["responsible"] + else: + resplist = [header["responsible"]] for person in header["responsible"]: firstname = person.split(" ")[0] lastname = person.split(" ")[1] -- GitLab