[browser2] add a validate method in order to check objet before returning him

This commit is contained in:
Bezleputh 2014-03-13 19:20:54 +01:00 committed by Romain Bignon
commit 7d59640712

View file

@ -497,6 +497,7 @@ class ItemElement(AbstractElement):
_attrs = None
klass = None
condition = None
validate = None
class Index(object):
pass
@ -528,6 +529,9 @@ class ItemElement(AbstractElement):
except SkipItem:
return
if self.validate is not None and not self.validate_object(self.obj):
return
yield self.obj
def handle_attr(self, key, func):