Salome HOME
82b749a2a8ee7e82c5556ef2d69698658191cfe2
[tools/configuration.git] / config / patches / edf / omniORBpy-4.2.1-2-python3.patch
1 diff -Naur a/python3/omniORB/__init__.py b/python3/omniORB/__init__.py
2 --- a/python3/omniORB/__init__.py       2015-06-08 13:39:59.000000000 +0200
3 +++ b/python3/omniORB/__init__.py       2017-05-09 14:57:00.521302183 +0200
4 @@ -458,17 +458,65 @@
5      def __repr__(self):
6          return self._n
7  
8 -    def __cmp__(self, other):
9 +    def __eq__(self, other):
10          try:
11              if isinstance(other, EnumItem):
12                  if other._parent_id == self._parent_id:
13 -                    return cmp(self._v, other._v)
14 +                    return self._v == other._v
15                  else:
16 -                    return cmp(self._parent_id, other._parent_id)
17 +                    return self._parent_id == other._parent_id
18              else:
19 -                return cmp(id(self), id(other))
20 +                return id(self) == id(other)
21          except:
22 -            return cmp(id(self), id(other))
23 +            return id(self) == id(other)
24 +
25 +    def __lt__(self, other):
26 +        try:
27 +            if isinstance(other, EnumItem):
28 +                if other._parent_id == self._parent_id:
29 +                    return self._v < other._v
30 +                else:
31 +                    return self._parent_id < other._parent_id
32 +            else:
33 +                return id(self) < id(other)
34 +        except:
35 +            return id(self) < id(other)
36 +
37 +    def __le__(self, other):
38 +        try:
39 +            if isinstance(other, EnumItem):
40 +                if other._parent_id == self._parent_id:
41 +                    return self._v <= other._v
42 +                else:
43 +                    return self._parent_id <= other._parent_id
44 +            else:
45 +                return id(self) <= id(other)
46 +        except:
47 +            return id(self) <= id(other)
48 +
49 +    def __gt__(self, other):
50 +        try:
51 +            if isinstance(other, EnumItem):
52 +                if other._parent_id == self._parent_id:
53 +                    return self._v > other._v
54 +                else:
55 +                    return self._parent_id > other._parent_id
56 +            else:
57 +                return id(self) > id(other)
58 +        except:
59 +            return id(self) > id(other)
60 +
61 +    def __ge__(self, other):
62 +        try:
63 +            if isinstance(other, EnumItem):
64 +                if other._parent_id == self._parent_id:
65 +                    return self._v >= other._v
66 +                else:
67 +                    return self._parent_id >= other._parent_id
68 +            else:
69 +                return id(self) >= id(other)
70 +        except:
71 +            return id(self) >= id(other)
72  
73      def __hash__(self):
74          return hash(self._parent_id + "/" + self._n)