summaryrefslogtreecommitdiff
path: root/py/python/Ice.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2007-07-17 16:01:09 -0700
committerMark Spruiell <mes@zeroc.com>2007-07-17 16:02:13 -0700
commit6471addf903e0f31b1e18c159d9c62715fb7bf49 (patch)
treed345c4e8fe9d8505f89aa06274a260e47df2c10f /py/python/Ice.py
parentAdded stringConverter (diff)
downloadice-6471addf903e0f31b1e18c159d9c62715fb7bf49.tar.bz2
ice-6471addf903e0f31b1e18c159d9c62715fb7bf49.tar.xz
ice-6471addf903e0f31b1e18c159d9c62715fb7bf49.zip
bug 2106: proxyAndIdentityFacet methods
Diffstat (limited to 'py/python/Ice.py')
-rw-r--r--py/python/Ice.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/py/python/Ice.py b/py/python/Ice.py
index a0b55ee41dc..ae0dba80962 100644
--- a/py/python/Ice.py
+++ b/py/python/Ice.py
@@ -1036,25 +1036,33 @@ del ConnectionLostException__str__
# Proxy comparison functions.
#
def proxyIdentityEqual(lhs, rhs):
+ return proxyIdentityCompare(lhs, rhs) == 0
+
+def proxyIdentityCompare(lhs, rhs):
if (lhs and not isinstance(lhs, ObjectPrx)) or (rhs and not isinstance(rhs, ObjectPrx)):
raise ValueError('argument is not a proxy')
if not lhs and not rhs:
return True
elif not lhs and rhs:
- return False
+ return -1
elif lhs and not rhs:
- return False
+ return 1
else:
- return lhs.ice_getIdentity() == rhs.ice_getIdentity()
+ return cmp(lhs.ice_getIdentity(), rhs.ice_getIdentity())
def proxyIdentityAndFacetEqual(lhs, rhs):
+ return proxyIdentityAndFacetCompare(lhs, rhs) == 0
+
+def proxyIdentityAndFacetCompare(lhs, rhs):
if (lhs and not isinstance(lhs, ObjectPrx)) or (rhs and not isinstance(rhs, ObjectPrx)):
raise ValueError('argument is not a proxy')
if not lhs and not rhs:
return True
elif not lhs and rhs:
- return False
+ return -1
elif lhs and not rhs:
- return False
+ return 1
+ elif lhs.ice_getIdentity() != rhs.ice_getIdentity():
+ return cmp(lhs.ice_getIdentity(), rhs.ice_getIdentity())
else:
- return lhs.ice_getIdentity() == rhs.ice_getIdentity() and lhs.ice_getFacet() == rhs.ice_getFacet()
+ return cmp(lhs.ice_getFacet(), rhs.ice_getFacet())