missing dists, sensors attributs nur schreiben wenn wirklich etwas fehlt.
This commit is contained in:
+10
-3
@@ -150,9 +150,16 @@ def prepare_data(rawdata:dict):
|
||||
dtunlength = rawdata["tunnels"]["length"]
|
||||
|
||||
# Fehler, welche im getpositions auftreten weiterführen: im Layout fehlende Dists / Sensoren / fehlende Attribute
|
||||
errors_dists = rawdata["not_found"]["missing_distributors"]
|
||||
errors_sensors = rawdata["not_found"]["missing_sensors"]
|
||||
errors_attributes = rawdata["not_found"]["missing_attributes"]
|
||||
errors_dists = list()
|
||||
errors_sensors = list()
|
||||
errors_attributes = dict()
|
||||
if "not_found" in rawdata:
|
||||
if "missing_distributors" in rawdata["not_found"]:
|
||||
errors_dists = rawdata["not_found"]["missing_distributors"]
|
||||
if "missing_sensors" in rawdata["not_found"]:
|
||||
errors_sensors = rawdata["not_found"]["missing_sensors"]
|
||||
if "missing_attributes" in rawdata["not_found"]:
|
||||
errors_attributes = rawdata["not_found"]["missing_attributes"]
|
||||
|
||||
|
||||
return (dracks, dsensors, dsubdists, mapping, dtunnels, dtunlength, errors_dists, errors_sensors, errors_attributes)
|
||||
|
||||
Reference in New Issue
Block a user