From 99a38a456da0151e3d72807650f9e2adc9de6dc9 Mon Sep 17 00:00:00 2001 From: Fabian Gerle Date: Fri, 6 Oct 2023 21:24:45 +0200 Subject: [PATCH] start writing MathGenealogy class --- MathGen.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/MathGen.py b/MathGen.py index 70f1e9e..c1b5611 100644 --- a/MathGen.py +++ b/MathGen.py @@ -371,10 +371,19 @@ class mathDB: class mathGenealogy(Graph): def __init__(self, DB="MathGen.db", vertices = None, directed=True): + self.db = mathDB(DB) super().__init__(directed=directed) - self.vs["name"] = "" + #self.vs["name"] = "" - def add_vertex + def add_person(self, vertex): + if "name" in vertex.keys(): + self.add_vertex(vertex["name"]) + else: + print("Mandatory entry 'name' is missing") + return() + for key in vertex: + val = vertex[key] + print(f"Dictionary contains {key} with value {val}")