+
+ # add data sets
+ try:
+ for item in ("reference", "compare"):
+ if element.get(item, None):
+ data_set = element[item].get("data", None)
+ if isinstance(data_set, str):
+ element[item]["data"] = \
+ self.configuration["data-sets"][data_set]
+
+ if element.get("history", None):
+ for i in range(len(element["history"])):
+ data_set = element["history"][i].get("data", None)
+ if isinstance(data_set, str):
+ element["history"][i]["data"] = \
+ self.configuration["data-sets"][data_set]
+
+ except KeyError:
+ raise PresentationError("Wrong data set used in {0}.".
+ format(element.get("title", "")))
+