diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2007-01-04 22:11:38 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2007-01-04 22:11:38 +0000 |
| commit | 443eca6549dca94d66264d9c7c9c2b7e2760cbd0 (patch) | |
| tree | 1a8f6c355127d77dcf59ea400e3744e49e5538f2 /python | |
| parent | 32df4fc8cdb72528c2ff718c821b7588ee87990c (diff) | |
| download | qpid-python-443eca6549dca94d66264d9c7c9c2b7e2760cbd0.tar.gz | |
svn merge -r492717:492730 from the trunk
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@492777 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/connection.py | 22 | ||||
| -rw-r--r-- | python/qpid/spec.py | 9 |
2 files changed, 17 insertions, 14 deletions
diff --git a/python/qpid/connection.py b/python/qpid/connection.py index 6f6c26559c..0b788e091b 100644 --- a/python/qpid/connection.py +++ b/python/qpid/connection.py @@ -59,7 +59,7 @@ class Connection: self.host = host self.port = port self.spec = spec - self.FRAME_END = self.spec.constants.byname["frame end"].id + self.FRAME_END = self.spec.constants.bypyname["frame_end"].id def connect(self): sock = socket.socket() @@ -78,14 +78,14 @@ class Connection: def write(self, frame): c = self.codec - c.encode_octet(self.spec.constants.byname[frame.payload.type].id) + c.encode_octet(self.spec.constants.bypyname[frame.payload.type].id) c.encode_short(frame.channel) frame.payload.encode(c) c.encode_octet(self.FRAME_END) def read(self): c = self.codec - type = self.spec.constants.byid[c.decode_octet()].name + type = pythonize(self.spec.constants.byid[c.decode_octet()].name) channel = c.decode_short() payload = Frame.DECODERS[type].decode(self.spec, c) end = c.decode_octet() @@ -96,14 +96,14 @@ class Connection: class Frame: - METHOD = "frame method" - HEADER = "frame header" - BODY = "frame body" - OOB_METHOD = "frame oob method" - OOB_HEADER = "frame oob header" - OOB_BODY = "frame oob body" - TRACE = "frame trace" - HEARTBEAT = "frame heartbeat" + METHOD = "frame_method" + HEADER = "frame_header" + BODY = "frame_body" + OOB_METHOD = "frame_oob_method" + OOB_HEADER = "frame_oob_header" + OOB_BODY = "frame_oob_body" + TRACE = "frame_trace" + HEARTBEAT = "frame_heartbeat" DECODERS = {} diff --git a/python/qpid/spec.py b/python/qpid/spec.py index 184ae157d1..0e3a477066 100644 --- a/python/qpid/spec.py +++ b/python/qpid/spec.py @@ -189,7 +189,8 @@ class Method(Metadata): "short": 0, "long": 0, "longlong": 0, - "timestamp": 0} + "timestamp": 0, + "content": None} def define_method(self, name): g = {Method.METHOD: self} @@ -233,9 +234,11 @@ def get_docs(nd): def load_fields(nd, l, domains): for f_nd in nd["field"]: try: - type = f_nd["@type"] + type = f_nd["@domain"] except KeyError: - type = domains[f_nd["@domain"]] + type = f_nd["@type"] + while domains.has_key(type) and domains[type] != type: + type = domains[type] l.add(Field(f_nd["@name"], f_nd.index(), type, get_docs(f_nd))) def load(specfile): |
