diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2008-05-08 20:52:28 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2008-05-08 20:52:28 +0000 |
| commit | fd5ba0c75091336020287825a973c88a07dbe5b4 (patch) | |
| tree | 5a90ff41987b15e85f254a9266d9c933cd505b9e /python/qpid/connection.py | |
| parent | 32613b43c550fec2785299a271b3818db75490c4 (diff) | |
| download | qpid-python-fd5ba0c75091336020287825a973c88a07dbe5b4.tar.gz | |
QPID-979: added access to enums through the session so that symbolic constants can be used rather than hard coded ones; also added default loading of the spec
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@654618 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/connection.py')
| -rw-r--r-- | python/qpid/connection.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/python/qpid/connection.py b/python/qpid/connection.py index dc72cd9cb8..39f882e9c3 100644 --- a/python/qpid/connection.py +++ b/python/qpid/connection.py @@ -25,7 +25,8 @@ from assembler import Assembler, Segment from codec010 import StringCodec from session import Session from invoker import Invoker -from spec010 import Control, Command +from spec010 import Control, Command, load +from spec import default from exceptions import * from logging import getLogger import delegates @@ -44,8 +45,10 @@ def server(*args): class Connection(Assembler): - def __init__(self, sock, spec, delegate=client): + def __init__(self, sock, spec=None, delegate=client): Assembler.__init__(self, sock) + if spec == None: + spec = load(default()) self.spec = spec self.track = self.spec["track"] @@ -162,9 +165,9 @@ class Channel(Invoker): def resolve_method(self, name): inst = self.connection.spec.instructions.get(name) if inst is not None and isinstance(inst, Control): - return inst + return self.METHOD, inst else: - return None + return self.ERROR, None def invoke(self, type, args, kwargs): ctl = type.new(args, kwargs) |
