diff options
author | Rafael H. Schloming <rhs@apache.org> | 2010-03-23 14:57:28 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2010-03-23 14:57:28 +0000 |
commit | fe99d24c4084b2cb2479b820a5b44378d1812ffc (patch) | |
tree | 82dd1a8c229d9d86e266870769b6460fad7dd2e0 /python/qpid/validator.py | |
parent | 166b7426164e35992d43d88b5c9e61c0482a41bd (diff) | |
download | qpid-python-fe99d24c4084b2cb2479b820a5b44378d1812ffc.tar.gz |
Several updates to address options including:
- renamed node-properties to node
- added link to permit durable links (with names)
- split x-properties into x-declare, x-subscribe, and x-bindings
- removed automatic passthrough of unrecognized options (as this was confusing)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@926604 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/validator.py')
-rw-r--r-- | python/qpid/validator.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/python/qpid/validator.py b/python/qpid/validator.py index 7bd62b68f8..d234642b3e 100644 --- a/python/qpid/validator.py +++ b/python/qpid/validator.py @@ -54,6 +54,20 @@ class Types: else: return "%s is not one of: %s" % (o, ", ".join([t.__name__ for t in self.types])) +class List: + + def __init__(self, condition): + self.condition = condition + + def validate(self, o, ctx): + if not isinstance(o, list): + return "%s is not a list" % o + + ctx.push(o) + for v in o: + err = self.condition.validate(v, ctx) + if err: return err + class Map: def __init__(self, map, restricted=True): |