+import inspect
+
+# In case the omniORBpy EnumItem class does not fully support Python 3
+# (for instance in version 4.2.1-2), the comparison ordering methods must be
+# defined
+#
+try:
+ SMESH.Entity_Triangle < SMESH.Entity_Quadrangle
+except TypeError:
+ def enumitem_eq(self, other):
+ try:
+ if isinstance(other, omniORB.EnumItem):
+ if other._parent_id == self._parent_id:
+ return self._v == other._v
+ else:
+ return self._parent_id == other._parent_id
+ else:
+ return id(self) == id(other)
+ except:
+ return id(self) == id(other)
+
+ def enumitem_lt(self, other):
+ try:
+ if isinstance(other, omniORB.EnumItem):
+ if other._parent_id == self._parent_id:
+ return self._v < other._v
+ else:
+ return self._parent_id < other._parent_id
+ else:
+ return id(self) < id(other)
+ except:
+ return id(self) < id(other)
+
+ def enumitem_le(self, other):
+ try:
+ if isinstance(other, omniORB.EnumItem):
+ if other._parent_id == self._parent_id:
+ return self._v <= other._v
+ else:
+ return self._parent_id <= other._parent_id
+ else:
+ return id(self) <= id(other)
+ except:
+ return id(self) <= id(other)
+
+ def enumitem_gt(self, other):
+ try:
+ if isinstance(other, omniORB.EnumItem):
+ if other._parent_id == self._parent_id:
+ return self._v > other._v
+ else:
+ return self._parent_id > other._parent_id
+ else:
+ return id(self) > id(other)
+ except:
+ return id(self) > id(other)
+
+ def enumitem_ge(self, other):
+ try:
+ if isinstance(other, omniORB.EnumItem):
+ if other._parent_id == self._parent_id:
+ return self._v >= other._v
+ else:
+ return self._parent_id >= other._parent_id
+ else:
+ return id(self) >= id(other)
+ except:
+ return id(self) >= id(other)
+
+ omniORB.EnumItem.__eq__ = enumitem_eq
+ omniORB.EnumItem.__lt__ = enumitem_lt
+ omniORB.EnumItem.__le__ = enumitem_le
+ omniORB.EnumItem.__gt__ = enumitem_gt
+ omniORB.EnumItem.__ge__ = enumitem_ge
+