diff options
Diffstat (limited to 'pyuno/source')
-rw-r--r-- | pyuno/source/module/pyuno_except.cxx | 3 | ||||
-rw-r--r-- | pyuno/source/module/uno.py | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx index 0d627dd2566e..ebe00ac6811b 100644 --- a/pyuno/source/module/pyuno_except.cxx +++ b/pyuno/source/module/pyuno_except.cxx @@ -162,6 +162,7 @@ static PyRef createClass( const OUString & name, const Runtime &runtime ) PyRef getter = getObjectFromUnoModule( runtime,"_uno_struct__getattr__" ); PyRef repr = getObjectFromUnoModule( runtime,"_uno_struct__repr__" ); PyRef eq = getObjectFromUnoModule( runtime,"_uno_struct__eq__" ); + PyRef ne = getObjectFromUnoModule( runtime,"_uno_struct__ne__" ); PyObject_SetAttrString( ret.get(), "__pyunostruct__", @@ -181,6 +182,8 @@ static PyRef createClass( const OUString & name, const Runtime &runtime ) ret.get(), "__str__", repr.get() ); PyObject_SetAttrString( ret.get(), "__eq__", eq.get() ); + PyObject_SetAttrString( + ret.get(), "__ne__", ne.get() ); } return ret; } diff --git a/pyuno/source/module/uno.py b/pyuno/source/module/uno.py index bccf22d0f8ac..6d671e620f21 100644 --- a/pyuno/source/module/uno.py +++ b/pyuno/source/module/uno.py @@ -170,6 +170,9 @@ class Enum: return (self.typeName == that.typeName) and (self.value == that.value) + def __ne__(self,other): + return not self.__eq__(other) + class Type: """Represents a UNO type. @@ -194,6 +197,9 @@ class Type: return self.typeClass == that.typeClass and self.typeName == that.typeName + def __ne__(self,other): + return not self.__eq__(other) + def __hash__(self): return self.typeName.__hash__() @@ -259,6 +265,9 @@ class Char: return False + def __ne__(self,other): + return not self.__eq__(other) + class ByteSequence: """Represents a UNO ByteSequence value. @@ -527,6 +536,8 @@ def _uno_struct__str__(self): return str(self.__dict__["value"]) +def _uno_struct__ne__(self, other): + return not self.__eq__(other) def _uno_struct__eq__(self, that): """Compares two UNO structs. |