Mercurial > farol > farolluz
diff farolluz/document.py @ 31:1ea1a3c3c790
Add method to change a Group ID
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Mon, 27 Oct 2014 12:29:56 +0100 |
parents | b15022ae484a |
children | b87f2a6e613a |
line wrap: on
line diff
--- a/farolluz/document.py Mon Oct 27 12:29:37 2014 +0100 +++ b/farolluz/document.py Mon Oct 27 12:29:56 2014 +0100 @@ -306,13 +306,22 @@ item._productids.remove(old) item._productids.append(new) + def mentionsGroupId(self, groupid): + for vulnerability in self._vulnerabilities: + for item in vulnerability.mentionsGroupId(groupid): + yield item + def isGroupOrphan(self, groupid): """ Returns if a group can be safely deleted """ - for vulnerability in self._vulnerabilities: - if vulnerability.isMentioningGroupId(groupid): - return False + for _ in self.mentionsGroupId(groupid): + return False return True + def changeGroupID(self, old, new): + for item in self.mentionsGroupId(old): + item._groupids.remove(old) + item._groupids.append(new) + def isProductTreeOrphan(self): """ Difference with the previous method is that we don;t care about inter-producttree references """