Created
June 17, 2013 08:09
-
-
Save savon-noir/5795363 to your computer and use it in GitHub Desktop.
NmapReport.__ne__ and NmapReport.__eq__ alternative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __ne__(self, other): | |
rval = True | |
if(self.__class__ == other.__class__ and self.id == other.id): | |
diffobj = self.diff(other) | |
rval = (len(diffobj.changed()) != 0 or | |
len(diffobj.added()) != 0 or | |
len(diffobj.removed()) != 0 | |
) | |
return rval | |
>>>>>>>>>>>>>>>>> | |
def __ne__(self, other): | |
rval = True | |
try: | |
diffobj = self.diff(other) | |
rval = (len(diffobj.changed()) != 0 or | |
len(diffobj.added()) != 0 or | |
len(diffobj.removed()) != 0 | |
) | |
Except NmapDiffException: | |
pass | |
return rval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment