From a37c5d802f50e6cb67c23ff779e62fdb73dbdf25 Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <alexander@mail-schlemmer.de> Date: Thu, 10 Feb 2022 10:20:26 +0100 Subject: [PATCH] DOC: added a new keyword role and some missing documentation --- src/caosadvancedtools/models/parser.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/caosadvancedtools/models/parser.py b/src/caosadvancedtools/models/parser.py index adf08392..654727d0 100644 --- a/src/caosadvancedtools/models/parser.py +++ b/src/caosadvancedtools/models/parser.py @@ -35,8 +35,10 @@ KEYWORDS = ["parent", # TODO: can we remove that, see: #36 "suggested_properties", "inherit_from_recommended", "inherit_from_suggested", - "inherit_from_obligatory", ] + "inherit_from_obligatory", + "role", ] +# TODO: check whether it's really ignored # These KEYWORDS are not forbidden as properties, but merely ignored. KEYWORDS_IGNORED = [ "unit", @@ -109,6 +111,10 @@ def parse_model_from_string(string): class Parser(object): def __init__(self): + """ + Initialize an empty parer object and initialize + the dictionary of entities and the list of treated elements. + """ self.model = {} self.treated = [] @@ -233,6 +239,8 @@ class Parser(object): """ adds names of Properties and RecordTypes to the model dictionary Properties are also initialized. + + name is the key of the yaml element and definition the value. """ if name == "__line__": -- GitLab