summaryrefslogtreecommitdiff
path: root/python/modules/IcePy/Communicator.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-03-01 15:12:26 +0100
committerJose <jose@zeroc.com>2016-03-01 15:12:26 +0100
commit1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd (patch)
tree38929143a6575d23e4438e590a20f525a829e194 /python/modules/IcePy/Communicator.cpp
parentFix LMDB nuget package version (diff)
parentIce::identityToString/Ice::stringToIdentity php/ruby/python implementations (diff)
downloadice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.tar.bz2
ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.tar.xz
ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.zip
Merge remote-tracking branch 'origin/3.6'
Diffstat (limited to 'python/modules/IcePy/Communicator.cpp')
-rw-r--r--python/modules/IcePy/Communicator.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/python/modules/IcePy/Communicator.cpp b/python/modules/IcePy/Communicator.cpp
index 3f2d56e4c32..c98f1f1c8f0 100644
--- a/python/modules/IcePy/Communicator.cpp
+++ b/python/modules/IcePy/Communicator.cpp
@@ -1737,3 +1737,52 @@ IcePy::getCommunicatorWrapper(const Ice::CommunicatorPtr& communicator)
Py_INCREF(obj->wrapper);
return obj->wrapper;
}
+
+extern "C"
+PyObject*
+IcePy_identityToString(PyObject* /*self*/, PyObject* obj)
+{
+ Ice::Identity id;
+ if(!getIdentity(obj, id))
+ {
+ return 0;
+ }
+
+ string str;
+
+ try
+ {
+ str = Ice::identityToString(id);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+
+ return createString(str);
+}
+
+extern "C"
+PyObject*
+IcePy_stringToIdentity(PyObject* /*self*/, PyObject* obj)
+{
+ string str;
+ if(!getStringArg(obj, "str", str))
+ {
+ return 0;
+ }
+
+ Ice::Identity id;
+ try
+ {
+ id = Ice::stringToIdentity(str);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return 0;
+ }
+
+ return createIdentity(id);
+}