def _delSelectedCallback(self,item): for i in self.items_selected: if i.type == "Host": api.devlog("delcallbackHost %s " % (i.object.name)) guiapi.delHost(i.object.getID()) elif i.type == "Application": api.devlog("delcallbackApplication %s " % (i.object.name)) _parent=i.object.getParent() _object=i.object guiapi.delApplication(_parent.getID(),_object.getID()) elif i.type == "Interface": api.devlog("delcallbackInterface %s " % (i.object.name)) _parent=i.object.getParent() _object=i.object guiapi.delInterface(_parent.getID(), _object.getID()) elif i.type == "Service": api.devlog("delcallbackService %s " % (i.name)) _object=i.object parent_interface = self._getParentForType(i, "Interface").object parent_host = self._getParentForType(i, "Host").object guiapi.delServiceFromInterface(parent_host.getID(), parent_interface.getID(), _object.getID()) self.listview.setCurrentItem(self.rootitem) self._itemSelected()
def _delInterfaceCallback(self, item): api.devlog("delcallbackInterface %s " % (item.object.name)) _parent=item.object.getParent() guiapi.delInterface(_parent.getID(), item.object.getID())