def generate_simple_markings(handling_markings): handling_list = list() for item in handling_markings: simple_structure = SimpleMarkingStructure(item['statement']) if not item.get("marking_model_name", None) is None: simple_structure.marking_model_name = item["marking_model_name"] handling_list.append(simple_structure) return handling_list
def append_handling(edge_object, handling_markings): if getattr(edge_object.obj, "handling", None) is None: edge_object.obj.handling = make_handling(edge_object.ty) else: purge_old_handling_caveats(edge_object) for handling in handling_markings: handling_caveat = SimpleMarkingStructure(handling) handling_caveat.marking_model_name = HANDLING_CAVEAT edge_object.obj.handling.markings[0].marking_structures.append(handling_caveat)