spaces am Ende der Zeilen entfernt

This commit is contained in:
2024-01-25 09:21:50 +01:00
parent 7785b14431
commit 4b82253f6b
+18 -18
View File
@@ -3,7 +3,7 @@ from controller import Controller
class CadItem(): class CadItem():
""" """
This item contains all data for writing all necessary data to the solid edg cad file This item contains all data for writing all necessary data to the solid edg cad file
""" """
# diese Daten bilden dann die Impfdaten # diese Daten bilden dann die Impfdaten
@@ -53,14 +53,14 @@ class CadItem():
"beschaffungsart_sivas", "beschaffungsart_neu", "beschaffungsart_sivas", "beschaffungsart_neu",
"mengeneinheit_sivas", "mengeneinheit_neu", "mengeneinheit_sivas", "mengeneinheit_neu",
"halbzeug_sivas", "halbzeug_neu", "halbzeug_sivas", "halbzeug_neu",
"tosgruppe_sivas", "tosgruppe_neu", "tosgruppe_sivas", "tosgruppe_neu",
"dispogruppe_sivas", "dispogruppe_neu", "dispogruppe_sivas", "dispogruppe_neu",
"dispolaufgruppe_sivas","dispolaufgruppe_neu", "dispolaufgruppe_sivas","dispolaufgruppe_neu",
"hersteller_sivas", "hersteller_neu", "hersteller_sivas", "hersteller_neu",
"ersatzfuer_sivas", "ersatzfuer_neu", "ersatzfuer_sivas", "ersatzfuer_neu",
"ersetztdurch_sivas", "ersetztdurch_neu", "ersetztdurch_sivas", "ersetztdurch_neu",
"herstteilenr_sivas", "herstteilenr_neu", "herstteilenr_sivas", "herstteilenr_neu",
"werkstoffdiskr_sivas", "werkstoffdiskr_sivas",
"werkstofftyp_sivas", "werkstofftyp_neu", "werkstofftyp_sivas", "werkstofftyp_neu",
"material_sivas", "material_neu", "material_sivas", "material_neu",
"oberflaeche_neu", "oberflaeche_neu",
@@ -106,12 +106,12 @@ class CadItem():
self.controller = controller self.controller = controller
def set_asm_id(self, asm_id): def set_asm_id(self, asm_id):
self.set_gui_data("asm_id", asm_id) self.set_gui_data("asm_id", asm_id)
def get_asm_id(self): def get_asm_id(self):
return self.get_gui_data("asm_id") return self.get_gui_data("asm_id")
def get_current_part_id(self): def get_current_part_id(self):
return self.get_gui_data("teilenummer") return self.get_gui_data("teilenummer")
def set_parent_children(self, parent_children_mapping): def set_parent_children(self, parent_children_mapping):
@@ -183,19 +183,19 @@ class CadItem():
if "gui_data" in jsonobj: if "gui_data" in jsonobj:
gui_data = jsonobj["gui_data"] gui_data = jsonobj["gui_data"]
self.set_gui_dict(gui_data) self.set_gui_dict(gui_data)
else: else:
raise Exception("no gui_data given in string") raise Exception("no gui_data given in string")
# if "data" in jsonobj: # if "data" in jsonobj:
# data = jsonobj["data"] # data = jsonobj["data"]
# self.set_data_dict(data) # self.set_data_dict(data)
# else: # else:
# raise Exception("no data given in string") # raise Exception("no data given in string")
if "parent_children_mapping" in jsonobj: if "parent_children_mapping" in jsonobj:
parent_children_mapping = jsonobj["parent_children_mapping"] parent_children_mapping = jsonobj["parent_children_mapping"]
self.set_parent_children(parent_children_mapping) self.set_parent_children(parent_children_mapping)
else: else:
raise Exception("no parent_children_mapping given in string") raise Exception("no parent_children_mapping given in string")
if "red_ids" in jsonobj: if "red_ids" in jsonobj:
red_ids = jsonobj["red_ids"] red_ids = jsonobj["red_ids"]
@@ -214,11 +214,11 @@ class CadItem():
# der Baum # der Baum
parent_children_mapping = self.get_parent_children() parent_children_mapping = self.get_parent_children()
jsonobj["parent_children_mapping"] = parent_children_mapping jsonobj["parent_children_mapping"] = parent_children_mapping
# die ids der nicht migrierten Dateien # die ids der nicht migrierten Dateien
red_ids = self.get_red_ids() red_ids = self.get_red_ids()
jsonobj["red_ids"] = red_ids jsonobj["red_ids"] = red_ids
return jsonobj return jsonobj
def to_json(self): def to_json(self):
obj = self.to_dict() obj = self.to_dict()
@@ -230,13 +230,13 @@ class CadItem():
self.from_json(json.load(f)) self.from_json(json.load(f))
except Exception: except Exception:
raise Exception("guid_data, data, parent_children_mapping or red_ids not found") raise Exception("guid_data, data, parent_children_mapping or red_ids not found")
def save(self, path): def save(self, path):
with open(path, 'w') as f: with open(path, 'w') as f:
json.dump(self.to_dict(), f) json.dump(self.to_dict(), f)
class CadItemRepository: class CadItemRepository:
""" """
container class for all CadItems in the local folder container class for all CadItems in the local folder
also just managed by the controller also just managed by the controller
""" """