summaryrefslogtreecommitdiff
path: root/python/qpid/spec.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-05-08 20:52:28 +0000
committerRafael H. Schloming <rhs@apache.org>2008-05-08 20:52:28 +0000
commitfd5ba0c75091336020287825a973c88a07dbe5b4 (patch)
tree5a90ff41987b15e85f254a9266d9c933cd505b9e /python/qpid/spec.py
parent32613b43c550fec2785299a271b3818db75490c4 (diff)
downloadqpid-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.py13
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):