summaryrefslogtreecommitdiff
path: root/python/qpid/messaging.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-08-11 15:40:19 +0000
committerRafael H. Schloming <rhs@apache.org>2009-08-11 15:40:19 +0000
commitd22ac4bbbd52fc8cbf80f864c49c904b0b24a529 (patch)
tree1f140400747e507d88d69695046e13a5efcf0e52 /python/qpid/messaging.py
parent0fc88ad654ed1dabf14c489ed5920b440a7fc6a2 (diff)
downloadqpid-python-d22ac4bbbd52fc8cbf80f864c49c904b0b24a529.tar.gz
- removed old and redundent tests
- removed old test harness in favor of qpid-python-test - modified qpid-python-test to support "skipped" tests, these are tests that failed due to an anticipated environmental reason such as the broker is not running or it is the wrong version - modified the qpid-python-test harness to exit with appropriate error codes based on the test results - modified the python clients to report version mismatches rather than framing errors - made qpid_config provide variables for 0-8, 0-9, and 0-10 versions of the spec - modified the 0-10 client to directly codegen classes - added new 0-10 framing layer based on push parsing rather than pull parsing - added numerous framing tests git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@803168 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/messaging.py')
-rw-r--r--python/qpid/messaging.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py
index f06ef87709..9b3fecbf9b 100644
--- a/python/qpid/messaging.py
+++ b/python/qpid/messaging.py
@@ -34,8 +34,8 @@ import connection, time, socket, sys, traceback
from codec010 import StringCodec
from datatypes import timestamp, uuid4, RangedSet, Message as Message010
from logging import getLogger
+from ops import PRIMITIVE
from session import Client, INCOMPLETE
-from spec import SPEC
from threading import Thread, RLock, Condition
from util import connect
@@ -191,9 +191,12 @@ class Connection(Lockable):
try:
self._socket = connect(self.host, self.port)
except socket.error, e:
- raise ConnectError(*e.args)
+ raise ConnectError(e)
self._conn = connection.Connection(self._socket)
- self._conn.start()
+ try:
+ self._conn.start()
+ except connection.VersionError, e:
+ raise ConnectError(e)
for ssn in self.sessions.values():
ssn._attach()
@@ -263,8 +266,8 @@ FILTER_DEFAULTS = {
def delegate(session):
class Delegate(Client):
- def message_transfer(self, cmd, headers, body):
- session._message_transfer(cmd, headers, body)
+ def message_transfer(self, cmd):
+ session._message_transfer(cmd)
return Delegate
class Session(Lockable):
@@ -314,9 +317,9 @@ class Session(Lockable):
link._disconnected()
@synchronized
- def _message_transfer(self, cmd, headers, body):
- m = Message010(body)
- m.headers = headers
+ def _message_transfer(self, cmd):
+ m = Message010(cmd.payload)
+ m.headers = cmd.headers
m.id = cmd.id
msg = self._decode(m)
rcv = self.receivers[int(cmd.destination)]
@@ -812,16 +815,16 @@ class Receiver(Lockable):
def codec(name):
- type = SPEC.named[name]
+ type = PRIMITIVE[name]
def encode(x):
- sc = StringCodec(SPEC)
- type.encode(sc, x)
+ sc = StringCodec()
+ sc.write_primitive(type, x)
return sc.encoded
def decode(x):
- sc = StringCodec(SPEC, x)
- return type.decode(sc)
+ sc = StringCodec(x)
+ return sc.read_primitive(type)
return encode, decode