efl.ecore.Timer Class

class efl.ecore.Timer(double interval, func, *args, **kargs)

This class represents a timer that will call the given func every interval seconds. The function will be passed any extra parameters given to constructor.

When the timer func is called, it must return a value of either True or False (remember that Python returns None if no value is explicitly returned and None evaluates to False). If it returns True, it will be called again at the next interval, or if it returns False it will be deleted automatically making any references/handles for it invalid.

Timers should be stopped/deleted by means of delete() or returning False from func, otherwise they’ll continue alive, even if the current python context delete it’s reference to it.

For convenience and readability callback can also return one of the Callback return values. That is ECORE_CALLBACK_RENEW (like returning True) or ECORE_CALLBACK_CANCEL (like returning False).

Parameters
  • interval (float) – interval in seconds.

  • func (callable) – function to callback when timer expires.

  • *args – All the remaining arguments will be passed back in the callback function.

  • **kwargs – All the remaining keyword arguments will be passed back in the callback function.

Expected func signature:

func(*args, **kargs): bool