diff --git a/VERSION b/VERSION index e95fe15e..43a6dc81 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.08.15.09.21.06 +Version 2.6.0-development+timestamp.2013.08.15.10.05.27 diff --git a/gluon/html.py b/gluon/html.py index 61a5bee8..da092a33 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -1075,10 +1075,8 @@ class DIV(XmlComponent): matches = [] # check if the component has an attribute with the same # value as provided - check = True tag = getattr(self, 'tag').replace('/', '') - if args and tag not in args: - check = False + check = not (args and tag not in args) for (key, value) in kargs.iteritems(): if key not in ['first_only', 'replace', 'find_text']: if isinstance(value, (str, int)): @@ -1109,24 +1107,28 @@ class DIV(XmlComponent): def replace_component(i): if replace is None: del self[i] - elif callable(replace): - self[i] = replace(self[i]) + return i else: - self[i] = replace + self[i] = replace(self[i]) if callable(replace) else replace + return i+1 # loop the components if find_text or find_components: - for i, c in enumerate(self.components): + i = 0 + while i