summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf2/python
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-09-21 21:48:41 +0000
committerTed Ross <tross@apache.org>2010-09-21 21:48:41 +0000
commit3cfbdf0e60c94733c0a79e94bdf8627afc6bb2a4 (patch)
treee33d57bca9a2c2275e76f882484ac3ea913e83fd /cpp/bindings/qmf2/python
parent449ab0f1062c0eac0234f84556de60436ba2ee9d (diff)
downloadqpid-python-3cfbdf0e60c94733c0a79e94bdf8627afc6bb2a4.tar.gz
QMFv2 Additions:
- QMFv2 schema encoding completed - Schema queries handled by the agent and initiated by the console by user request - Full query support with predicates evaluated on the agent (regex not yet implemented) - Agent filtering in the console - Agent aging in the console - Unit tests git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@999662 13f79535-47bb-0310-9956-ffa450edef68
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)