Mercurial > libervia-desktop-kivy
comparison cagou/core/utils.py @ 253:112ba3295f8f
core (utils): use generator when checking continue_tests in FilterBehavior:
using a list was doing all the tests when the first one could fail, resulting in an exception in FileSharing.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 26 Jan 2019 20:24:48 +0100 |
parents | 9faccd140119 |
children | 1b835bcfa663 |
comparison
equal
deleted
inserted
replaced
252:fdda914a298b | 253:112ba3295f8f |
---|---|
54 """ | 54 """ |
55 text = text.strip().lower() | 55 text = text.strip().lower() |
56 filtering = len(text)>len(self._filter_last) | 56 filtering = len(text)>len(self._filter_last) |
57 self._filter_last = text | 57 self._filter_last = text |
58 for child in self.layout.children: | 58 for child in self.layout.children: |
59 if continue_tests is not None and any([t(child) for t in continue_tests]): | 59 if continue_tests is not None and any((t(child) for t in continue_tests)): |
60 continue | 60 continue |
61 if text in get_child_text(child).lower(): | 61 if text in get_child_text(child).lower(): |
62 self._filter_anim.cancel(child) | 62 self._filter_anim.cancel(child) |
63 for key, method in (('width', width_cb), | 63 for key, method in (('width', width_cb), |
64 ('height', height_cb), | 64 ('height', height_cb), |