summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf2/python
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/bindings/qmf2/python')
-rw-r--r--cpp/bindings/qmf2/python/python.i11
-rw-r--r--cpp/bindings/qmf2/python/qmf2.py15
2 files changed, 20 insertions, 6 deletions
diff --git a/cpp/bindings/qmf2/python/python.i b/cpp/bindings/qmf2/python/python.i
index 7d83465bb3..02dd1632b0 100644
--- a/cpp/bindings/qmf2/python/python.i
+++ b/cpp/bindings/qmf2/python/python.i
@@ -23,13 +23,16 @@
/* Define the general-purpose exception handling */
%exception {
+ std::string error;
+ Py_BEGIN_ALLOW_THREADS;
try {
- Py_BEGIN_ALLOW_THREADS
$action
- Py_END_ALLOW_THREADS
+ } catch (qpid::types::Exception& ex) {
+ error = ex.what();
}
- catch (qpid::types::Exception& ex) {
- PyErr_SetString(PyExc_RuntimeError, ex.what());
+ Py_END_ALLOW_THREADS;
+ if (!error.empty()) {
+ PyErr_SetString(PyExc_RuntimeError, error.c_str());
return NULL;
}
}
diff --git a/cpp/bindings/qmf2/python/qmf2.py b/cpp/bindings/qmf2/python/qmf2.py
index f3ece32866..285b47ebbe 100644
--- a/cpp/bindings/qmf2/python/qmf2.py
+++ b/cpp/bindings/qmf2/python/qmf2.py
@@ -54,6 +54,11 @@ SEV_NOTICE = cqmf2.SEV_NOTICE
SEV_INFORM = cqmf2.SEV_INFORM
SEV_DEBUG = cqmf2.SEV_DEBUG
+QUERY_OBJECT = cqmf2.QUERY_OBJECT
+QUERY_OBJECT_ID = cqmf2.QUERY_OBJECT_ID
+QUERY_SCHEMA = cqmf2.QUERY_SCHEMA
+QUERY_SCHEMA_ID = cqmf2.QUERY_SCHEMA_ID
+
#===================================================================================================
# EXCEPTIONS
@@ -153,7 +158,7 @@ class ConsoleSession(object):
def setAgentFilter(self, filt):
"""
"""
- self.setAgentFilter(filt)
+ self._impl.setAgentFilter(filt)
def open(self):
"""
@@ -321,6 +326,12 @@ class Agent(object):
dataList.append(Data(result.getData(i)))
return dataList
+ def loadSchemaInfo(self, timeout=30):
+ """
+ """
+ dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
+ self._impl.querySchema(dur)
+
def getPackages(self):
"""
"""
@@ -457,7 +468,7 @@ class Data(object):
result = agent.callMethod(name, argmap, addr, dur)
##
- ## If the agent sent an exception, raise it in a QmfAgentExeption.
+ ## If the agent sent an exception, raise it in a QmfAgentException.
##
if result.getType() == cqmf2.CONSOLE_EXCEPTION:
exdata = result.getData(0)