Skip to content

Instantly share code, notes, and snippets.

@savon-noir
Created June 17, 2013 08:09
Show Gist options
  • Save savon-noir/5795363 to your computer and use it in GitHub Desktop.
Save savon-noir/5795363 to your computer and use it in GitHub Desktop.
NmapReport.__ne__ and NmapReport.__eq__ alternative
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