def remove_link(self, sender_uuid: str, sender_attribute: str, receiver_uuid: str, receiver_attribute: str) -> None: if sender_uuid != "" and sender_attribute != "" and receiver_uuid != "" and receiver_attribute != "": lr = PySI.LinkRelation(sender_uuid, sender_attribute, receiver_uuid, receiver_attribute) if lr in self.link_relations: del self.link_relations[self.link_relations.index(lr)]
def test_scope_datastructure_LinkRelation(self): lr = PySI.LinkRelation("test", "attrib_test", "test2", "attrib_test2") self.assertNotEqual(lr, None) self.assertEqual(lr.sender, "test") self.assertEqual(lr.sender_attrib, "attrib_test") self.assertEqual(lr.recv, "test2") self.assertEqual(lr.recv_attrib, "attrib_test2")
def on_move_leave_recv(self, cursor_id, link_attrib): if not cursor_id == "" and not link_attrib == "": lr = PySI.LinkRelation(cursor_id, link_attrib, self._uuid, link_attrib) if lr in self.link_relations: del self.link_relations[self.link_relations.index(lr)] self.is_under_user_control = False return 0
def on_move_leave_recv(self, cursor_id, link_attrib): lr = PySI.LinkRelation(cursor_id, link_attrib, self._uuid, link_attrib) if lr in self.link_relations: del self.link_relations[self.link_relations.index(lr)]