From fe99d24c4084b2cb2479b820a5b44378d1812ffc Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 23 Mar 2010 14:57:28 +0000 Subject: 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 --- python/qpid/validator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'python/qpid/validator.py') 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): -- cgit v1.2.1