From 713c0c114f8d344beb58d5f99d0cb602485399cf Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Mon, 10 Mar 2008 19:12:09 +0000 Subject: renamed datatypes.Struct.type -> datatypes.Struct._type; this avoids naming conflicts with metadata-driven fields; moved argument validation -> datatypes.Struct and improved error checking; improved datatypes.Struct.__repr__ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@635660 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/session.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'python/qpid/session.py') diff --git a/python/qpid/session.py b/python/qpid/session.py index 7a84fa601d..8374b8cd3d 100644 --- a/python/qpid/session.py +++ b/python/qpid/session.py @@ -129,7 +129,8 @@ class Session(Invoker): cmd = type.new(args, kwargs) sc = StringCodec(self.spec) - sc.write_command(type, cmd) + hdr = Struct(self.spec["session.header"]) + sc.write_command(hdr, cmd) seg = Segment(True, (message == None or (message.headers == None and message.body == None)), @@ -174,10 +175,10 @@ class Session(Invoker): def dispatch(self, assembly): segments = assembly[:] - cmd = assembly.pop(0).decode(self.spec) + hdr, cmd = assembly.pop(0).decode(self.spec) args = [] - for st in cmd.type.segments: + for st in cmd._type.segments: if assembly: seg = assembly[0] if seg.type == st.segment_type: @@ -188,10 +189,10 @@ class Session(Invoker): assert len(assembly) == 0 - attr = cmd.type.qname.replace(".", "_") + attr = cmd._type.qname.replace(".", "_") result = getattr(self.delegate, attr)(cmd, *args) - if cmd.type.result: + if cmd._type.result: self.execution_result(cmd.id, result) if result is not INCOMPLETE: -- cgit v1.2.1