missing dists, sensors attributs nur schreiben wenn wirklich etwas fehlt.
This commit is contained in:
+7
-3
@@ -810,20 +810,24 @@ def check_file_in_work(work_dir: Path, filename: Path) -> tuple[Path, bool]:
|
||||
|
||||
def check_existance(res_mappings: dict, res_dist: dict, res_pos: dict, res_tunnel: dict) -> dict:
|
||||
ret = dict()
|
||||
ret["missing_distributors"] = list()
|
||||
ret["missing_sensors"] = list()
|
||||
ret["missing_tunnel"] = list()
|
||||
|
||||
for dname in res_mappings.keys():
|
||||
if dname not in res_dist:
|
||||
if "missing_distributors" not in ret:
|
||||
ret["missing_distributors"] = list()
|
||||
ret["missing_distributors"].append(dname)
|
||||
for sname, lofsensors in res_mappings.items():
|
||||
for s in lofsensors:
|
||||
if s not in res_pos:
|
||||
if "missing_sensors" not in ret:
|
||||
ret["missing_sensors"] = list()
|
||||
ret['missing_sensors'].append(s)
|
||||
for tname in res_tunnel.keys():
|
||||
if tname == "length": # dict enthält auch die Länge aller Tunnels in einem Key
|
||||
continue
|
||||
if len(res_tunnel[tname]) < 2 :
|
||||
if "missing_tunnel" not in ret:
|
||||
ret["missing_tunnel"] = list()
|
||||
ret["missing_tunnel"].append(tname)
|
||||
if len(res_tunnel[tname]) > 2 :
|
||||
if "overdefined_tunnel" not in ret:
|
||||
|
||||
Reference in New Issue
Block a user