diff options
| author | Gordon Sim <gsim@apache.org> | 2008-03-26 18:38:35 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-03-26 18:38:35 +0000 |
| commit | 719c2529a14527c236e871603136ccbe44f632d3 (patch) | |
| tree | 499f5c7b1d2348e46e34cb12d9c9dd5169901022 /python/qpid | |
| parent | 5c8e2d27f805eff9f6a457d895fa38dc495301fd (diff) | |
| download | qpid-python-719c2529a14527c236e871603136ccbe44f632d3.tar.gz | |
Update to dtx inline with latest spec:
* Updated dtx handling in c++ broker to take account of separation of completion and acceptance.
* Added final dtx method defs to extra xml fragment and implemented appropriate handlers in c++ broker.
* Converted dtx python tests (recover test still requires some work on decoding arrays).
* Allow creation of structs without type codes through a python session method.
* Fixed exception handling in python client for commands with results.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@641464 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
| -rw-r--r-- | python/qpid/datatypes.py | 3 | ||||
| -rw-r--r-- | python/qpid/session.py | 5 | ||||
| -rw-r--r-- | python/qpid/spec010.py | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/python/qpid/datatypes.py b/python/qpid/datatypes.py index 59299b6e04..0893269174 100644 --- a/python/qpid/datatypes.py +++ b/python/qpid/datatypes.py @@ -154,6 +154,7 @@ class Future: self.value = initial self._error = None self._set = threading.Event() + self.exception = exception def error(self, error): self._error = error @@ -166,7 +167,7 @@ class Future: def get(self, timeout=None): self._set.wait(timeout) if self._error != None: - raise exception(self._error) + raise self.exception(self._error) return self.value def is_set(self): diff --git a/python/qpid/session.py b/python/qpid/session.py index 4da6f883b4..bbe2b326d6 100644 --- a/python/qpid/session.py +++ b/python/qpid/session.py @@ -110,6 +110,8 @@ class Session(Invoker): for st in self.spec.structs.values(): if st.name == name: return st + if self.spec.structs_by_name.has_key(name): + return self.spec.structs_by_name[name] return None def invoke(self, type, args, kwargs): @@ -289,8 +291,9 @@ class Delegate: self.session.exceptions.append(ex) error = self.session.error() for id in self.session.results: - f = self.session.results.pop(id) + f = self.session.results[id] f.error(error) + self.session.results.clear() for q in self.session._incoming.values(): q.close(error) diff --git a/python/qpid/spec010.py b/python/qpid/spec010.py index 815c1d064a..4eb03008d0 100644 --- a/python/qpid/spec010.py +++ b/python/qpid/spec010.py @@ -257,6 +257,7 @@ class Struct(Composite): Composite.register(self, node) if self.code is not None: self.spec.structs[self.code] = self + self.spec.structs_by_name[self.name] = self def __str__(self): fields = ",\n ".join(["%s: %s" % (f.name, f.type.qname) @@ -443,6 +444,7 @@ class Spec(Node): self.controls = {} self.commands = {} self.structs = {} + self.structs_by_name = {} def encoding(self, klass): if Spec.ENCODINGS.has_key(klass): |
