make inequality comparison work

This commit is contained in:
Maximilian Hils 2014-09-04 19:18:43 +02:00
parent ef0e501877
commit d9a731b23a
2 changed files with 6 additions and 0 deletions

View File

@ -285,6 +285,9 @@ class SSLCert:
def __eq__(self, other):
return self.digest("sha1") == other.digest("sha1")
def __ne__(self, other):
return not self.__eq__(other)
@classmethod
def from_pem(klass, txt):
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, txt)

View File

@ -24,6 +24,9 @@ class ODict:
def __eq__(self, other):
return self.lst == other.lst
def __ne__(self, other):
return not self.__eq__(other)
def __iter__(self):
return self.lst.__iter__()