Jingle: backport of py2.5-only function

This commit is contained in:
Tomasz Melcer 2007-08-24 15:44:49 +00:00
parent da072e7b5f
commit d3a4029288
1 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,12 @@ sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL)
import farsight
sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_LOCAL)
def all(iterable): # backport of py2.5 function
for element in iterable:
if not element:
return False
return True
def timeout_add_and_call(timeout, callable, *args, **kwargs):
''' Call a callback once. If it returns True, add a timeout handler to call it more times.
Helper function. '''