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/spec.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/spec.py')
| -rw-r--r-- | python/qpid/spec.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/python/qpid/spec.py b/python/qpid/spec.py index 64a14b0f61..152763b762 100644 --- a/python/qpid/spec.py +++ b/python/qpid/spec.py @@ -31,6 +31,19 @@ situations. import os, mllib, spec08, spec010 +def default(): + try: + specfile = os.environ["AMQP_SPEC"] + return specfile + except KeyError: + try: + from AMQP_SPEC import location as specfile + return specfile + except ImportError: + raise Exception("unable to locate the amqp specification, please set " + "the AMQP_SPEC environment variable or supply a " + "configured AMQP_SPEC.py") + def load(specfile, *errata): for name in (specfile,) + errata: if not os.path.exists(name): |
