Module Expr Str Assign NameStore TupleLoad Str Str Str Str ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier Import alias TryExcept body Import alias If CompareIn NameLoad TupleLoad Str Str body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpMult UnaryOpUSub NameLoad Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list decorator_list orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr Str orelse ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str keyword NameLoad FunctionDef arguments args defaults body ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Assign NameStore ListLoad TupleLoad Str AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr decorator_list Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore Num orelse If CompareIn Str NameLoad body Assign NameStore Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad orelse Assign NameStore Num Assign NameStore Call NameLoad FunctionDef arguments args defaults body If CompareNotEq Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr Raise Call NameLoad NameLoad Call NameLoad NameLoad Return BinOpAdd AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num decorator_list Return NameLoad decorator_list Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Call NameLoad NameLoad decorator_list decorator_list handlers ExceptHandler type TupleLoad NameLoad NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad BinOpDiv NameLoad Num decorator_list decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd Call NameLoad NameLoad Str CompareIsNot AttributeLoad NameLoad attr NameLoad body Return BinOpRShift BinOpBitAnd Call NameLoad AttributeLoad NameLoad attr Num Num Return BinOpRShift BinOpBitAnd Call NameLoad NameLoad Num Num decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num If NameLoad body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Return NameLoad Assign NameStore AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr body Return NameLoad Return Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad TryExcept body Expr Call AttributeLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Pass decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareLt BinOpSub NameLoad AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr Num body Return NameLoad Assign AttributeStore NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr NameLoad TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass Assign NameStore Call NameLoad AttributeLoad NameLoad attr If BoolOpAnd NameLoad CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore Num Assign NameStore BinOpSub NameLoad Num FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr ListComp ListLoad comprehension NameStore Call NameLoad Num Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr If CompareGt AttributeLoad NameLoad attr Num body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpSub BinOpDiv Num NameLoad BinOpSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr While CompareGt BinOpSub NameLoad NameLoad NameLoad body Expr Call NameLoad BinOpMult Num BinOpSub NameLoad NameLoad Assign NameStore BinOpSub BinOpDiv Num NameLoad BinOpSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num AugAssignAdd AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse If CompareGt BinOpSub NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad BinOpSub NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num AugAssignAdd AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr orelse If NameLoad body For NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Call NameLoad NameLoad Slice body If CompareEq Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr orelse For NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Call NameLoad NameLoad Slice body If CompareEq Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Break decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body For NameStore SubscriptLoad NameLoad Slice body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body For NameStore AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr For NameStore SubscriptLoad NameLoad Slice body If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr While NameLoad body AugAssignSub NameStore Num If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Break Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr For NameStore SubscriptLoad NameLoad Slice body If CompareNotEq AttributeLoad NameLoad attr Num body Continue Assign NameStore NameLoad If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad Call NameLoad NameLoad decorator_list Assign AttributeStore AttributeLoad NameLoad attr attr Str FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body FunctionDef arguments args NameParam defaults body Expr Call NameLoad NameLoad NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list Call NameLoad NameLoad Return NameLoad decorator_list If CompareIn Str NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str NameLoad
N/A N/A 
Clock object
============

The :class:`Clock` object allows you to schedule a function call in the
future; once or repeatedly at specified intervals. You can get the time
elapsed between the scheduling and the calling of the callback via the
`dt` argument::

    # dt means delta-time
    def my_callback(dt):
        pass

    # call my_callback every 0.5 seconds
    Clock.schedule_interval(my_callback, 0.5)

    # call my_callback in 5 seconds
    Clock.schedule_once(my_callback, 5)

    # call my_callback as soon as possible (usually next frame.)
    Clock.schedule_once(my_callback)

.. note::

    If the callback returns False, the schedule will be removed.

If you want to schedule a function to call with default arguments, you can use
the `functools.partial
<http://docs.python.org/library/functools.html#functools.partial>`_ python
module::

    from functools import partial

    def my_callback(value, key, *largs):
        pass

    Clock.schedule_interval(partial(my_callback, 'my value', 'my key'), 0.5)

Conversely, if you want to schedule a function that doesn't accept the dt
argument, you can use a `lambda
<http://docs.python.org/2/reference/expressions.html#lambda>`_ expression
to write a short function that does accept dt. For Example::

    def no_args_func():
        print("I accept no arguments, so don't schedule me in the clock")

    Clock.schedule_once(lambda dt: no_args_func(), 0.5)

.. note::

    You cannot unschedule an anonymous function unless you keep a
    reference to it. It's better to add \*args to your function
    definition so that it can be called with an arbitrary number of
    parameters.

.. important::

    The callback is weak-referenced: you are responsible for keeping a
    reference to your original object/callback. If you don't keep a
    reference, the ClockBase will never execute your callback. For
    example::

        class Foo(object):
            def start(self):
                Clock.schedule_interval(self.callback, 0.5)

            def callback(self, dt):
                print('In callback')

        # A Foo object is created and the method start is called.
        # Because no reference is kept to the instance returned from Foo(),
        # the object will be collected by the Python Garbage Collector and
        # your callback will be never called.
        Foo().start()

        # So you should do the following and keep a reference to the instance
        # of foo until you don't need it anymore!
        foo = Foo()
        foo.start()


.. _schedule-before-frame:

Schedule before frame
---------------------

.. versionadded:: 1.0.5

Sometimes you need to schedule a callback BEFORE the next frame. Starting
from 1.0.5, you can use a timeout of -1::

    Clock.schedule_once(my_callback, 0) # call after the next frame
    Clock.schedule_once(my_callback, -1) # call before the next frame

The Clock will execute all the callbacks with a timeout of -1 before the
next frame even if you add a new callback with -1 from a running
callback. However, :class:`Clock` has an iteration limit for these
callbacks: it defaults to 10.

If you schedule a callback that schedules a callback that schedules a .. etc
more than 10 times, it will leave the loop and send a warning to the console,
then continue after the next frame. This is implemented to prevent bugs from
hanging or crashing the application.

If you need to increase the limit, set the :attr:`max_iteration` property::

    from kivy.clock import Clock
    Clock.max_iteration = 20

.. _triggered-events:

Triggered Events
----------------

.. versionadded:: 1.0.5

A triggered event is a way to defer a callback exactly like schedule_once(),
but with some added convenience. The callback will only be scheduled once per
frame even if you call the trigger twice (or more). This is not the case
with :meth:`Clock.schedule_once`::

    # will run the callback twice before the next frame
    Clock.schedule_once(my_callback)
    Clock.schedule_once(my_callback)

    # will run the callback once before the next frame
    t = Clock.create_trigger(my_callback)
    t()
    t()

Before triggered events, you may have used this approach in a widget::

    def trigger_callback(self, *largs):
        Clock.unschedule(self.callback)
        Clock.schedule_once(self.callback)

As soon as you call `trigger_callback()`, it will correctly schedule the
callback once in the next frame. It is more convenient to create and bind to
the triggered event than using :meth:`Clock.schedule_once` in a function::

    from kivy.clock import Clock
    from kivy.uix.widget import Widget

    class Sample(Widget):
        def __init__(self, **kwargs):
            self._trigger = Clock.create_trigger(self.cb)
            super(Sample, self).__init__(**kwargs)
            self.bind(x=self._trigger, y=self._trigger)

        def cb(self, *largs):
            pass

Even if x and y changes within one frame, the callback is only run once.

.. note::

    :meth:`ClockBase.create_trigger` also has a timeout parameter that
    behaves exactly like :meth:`ClockBase.schedule_once`.

Threading
----------

.. versionadded:: 1.9.0

Often, other threads are used to schedule callbacks with kivy's main thread
using :class:`ClockBase`. Therefore, it's important to know what is thread safe
and what isn't.

All the :class:`ClockBase` and :class:`ClockEvent` methods are safe with
respect to kivy's thread. That is, it's always safe to call these methods
from a single thread that is not the kivy thread. However, there are no
guarantees as to the order in which these callbacks will be executed.

Calling a previously created trigger from two different threads (even if one
of them is the kivy thread), or calling the trigger and its
:meth:`ClockEvent.cancel` method from two different threads at the same time is
not safe. That is, although no exception will be raised, there no guarantees
that calling the trigger from two different threads will not result in the
callback being executed twice, or not executed at all. Similarly, such issues
might arise when calling the trigger and canceling it with
:meth:`ClockBase.unschedule` or :meth:`ClockEvent.cancel` from two threads
simultaneously.

Therefore, it is safe to call :meth:`ClockBase.create_trigger`,
:meth:`ClockBase.schedule_once`, :meth:`ClockBase.schedule_interval`, or
call or cancel a previously created trigger from an external thread.
The following code, though, is not safe because it calls or cancels
from two threads simultaneously without any locking mechanism::

    event = Clock.create_trigger(func)

    # in thread 1
    event()
    # in thread 2
    event()
    # now, the event may be scheduled twice or once

    # the following is also unsafe
    # in thread 1
    event()
    # in thread 2
    event.cancel()
    # now, the event may or may not be scheduled and a subsequent call
    # may schedule it twice

Note, in the code above, thread 1 or thread 2 could be the kivy thread, not
just an external thread.
 N/A __all__ N/A Clock ClockBase ClockEvent mainthread sys platform os environ functools wraps partial kivy.context register_context kivy.weakmethod WeakMethod kivy.config Config kivy.logger Logger kivy.compat clock _default_time N/A time N/A N/A N/A ctypes N/A N/A platform N/A win32 cygwin N/A N/A _kernel32 N/A N/A ctypes windll kernel32 _ClockBase N/A object N/A __init__ N/A N/A self N/A N/A N/A N/A self _timer N/A N/A _kernel32 CreateWaitableTimerA None True None N/A usleep N/A N/A self microseconds N/A N/A N/A delay N/A N/A ctypes c_longlong N/A int N/A N/A microseconds 10 N/A N/A N/A _kernel32 SetWaitableTimer N/A self _timer N/A N/A ctypes byref delay 0 N/A N/A ctypes c_void_p N/A N/A ctypes c_void_p False N/A N/A N/A _kernel32 WaitForSingleObject N/A self _timer 4294967295 N/A N/A N/A N/A N/A platform darwin N/A N/A _libc N/A N/A ctypes CDLL libc.dylib N/A ctypes.util find_library N/A _libc N/A N/A ctypes CDLL N/A find_library c use_errno True _libc_clock_gettime_wrapper N/A N/A N/A N/A os strerror struct_tv N/A N/A ctypes Structure N/A N/A _fields_ N/A N/A tv_sec N/A ctypes c_long N/A tv_usec N/A ctypes c_long N/A N/A _clock_gettime N/A _libc clock_gettime N/A N/A _clock_gettime argtypes N/A N/A ctypes c_long N/A N/A ctypes POINTER struct_tv N/A N/A linux platform N/A N/A _clockid 4 N/A N/A N/A freebsd platform N/A N/A _clockid 11 N/A N/A N/A Logger debug N/A N/A clock.py: {{{:s}}} clock ID {:d} format platform _clockid N/A N/A _clockid 1 N/A tv N/A struct_tv _time N/A N/A N/A N/A N/A N/A N/A _clock_gettime N/A N/A ctypes c_long _clockid N/A N/A ctypes pointer tv 0 N/A N/A _ernno N/A N/A ctypes get_errno N/A N/A OSError _ernno N/A strerror _ernno N/A N/A N/A tv tv_sec N/A N/A tv tv_usec 1e-09 N/A N/A _time N/A N/A _default_time N/A _libc_clock_gettime_wrapper N/A N/A N/A _libc usleep argtypes N/A N/A ctypes c_ulong N/A _libc_usleep N/A _libc usleep _ClockBase N/A object N/A usleep N/A N/A self microseconds N/A N/A N/A N/A _libc_usleep N/A int microseconds N/A N/A N/A N/A N/A N/A OSError ImportError AttributeError N/A N/A _default_sleep N/A time sleep _ClockBase N/A object N/A usleep N/A N/A self microseconds N/A N/A N/A N/A _default_sleep N/A microseconds 1000000.0 N/A N/A _hash N/A N/A cb N/A N/A N/A N/A N/A hasattr cb __self__ N/A N/A cb __self__ None N/A N/A N/A N/A N/A id N/A cb __self__ 65280 8 N/A N/A N/A N/A id cb 65280 8 N/A ClockEvent N/A object N/A N/A  A class that describes a callback scheduled with kivy's :attr:`Clock`.
    This class is never created by the user; instead, kivy creates and returns
    an instance of this class when scheduling a callback.

    .. warning::
        Most of the methods of this class are internal and can change without
        notice. The only exception are the :meth:`cancel` and
        :meth:`__call__` methods.
     __init__ N/A N/A self clock loop callback timeout starttime cid trigger N/A False N/A N/A N/A self clock clock N/A N/A self cid cid N/A N/A self loop loop N/A N/A self weak_callback None N/A N/A self callback callback N/A N/A self timeout timeout N/A N/A self _is_triggered trigger N/A N/A self _last_dt starttime N/A N/A self _dt 0.0 N/A trigger N/A N/A N/A N/A N/A N/A clock _events N/A cid append self N/A __call__ N/A N/A self N/A largs N/A N/A  Schedules the callback associated with this instance.
        If the callback is already scheduled, it will not be scheduled again.
         N/A N/A N/A self _is_triggered False N/A N/A N/A self _is_triggered True N/A N/A self _last_dt N/A N/A self clock _last_tick N/A N/A N/A N/A N/A N/A self clock _events N/A N/A self cid append self N/A True N/A get_callback N/A N/A self N/A N/A N/A callback N/A self callback N/A N/A callback None N/A N/A callback N/A callback N/A self weak_callback N/A N/A N/A callback is_dead N/A N/A None N/A N/A callback N/A is_triggered N/A N/A self N/A N/A N/A N/A self _is_triggered N/A property cancel N/A N/A self N/A N/A N/A  Cancels the callback if it was scheduled to be called.
         N/A N/A self _is_triggered N/A N/A N/A self _is_triggered False N/A N/A N/A N/A N/A N/A N/A N/A self clock _events N/A N/A self cid remove self N/A N/A N/A ValueError N/A N/A N/A release N/A N/A self N/A N/A N/A N/A self weak_callback N/A WeakMethod N/A self callback N/A N/A self callback None N/A tick N/A N/A self curtime remove N/A N/A N/A N/A N/A curtime N/A self _last_dt N/A N/A self timeout 0.005 N/A N/A True N/A N/A self _dt N/A curtime N/A self _last_dt N/A N/A self _last_dt curtime N/A loop N/A self loop N/A callback N/A N/A self get_callback N/A N/A callback None N/A N/A N/A self _is_triggered False N/A N/A N/A N/A remove self N/A N/A N/A ValueError N/A N/A N/A False N/A N/A loop N/A N/A N/A self _is_triggered False N/A N/A N/A N/A remove self N/A N/A N/A ValueError N/A N/A N/A ret N/A callback N/A self _dt N/A N/A loop N/A ret False N/A N/A N/A self _is_triggered False N/A N/A N/A N/A remove self N/A N/A N/A ValueError N/A N/A N/A False N/A loop N/A __repr__ N/A N/A self N/A N/A N/A N/A <ClockEvent callback=%r> N/A N/A self get_callback N/A N/A ClockBase N/A _ClockBase N/A N/A A clock object with event support.
     N/A __slots__ N/A _dt _last_fps_tick _last_tick _fps _rfps _start_tick _fps_counter _rfps_counter _events _frames _frames_displayed _max_fps max_iteration N/A MIN_SLEEP 0.005 N/A SLEEP_UNDERSHOOT N/A MIN_SLEEP 0.001 __init__ N/A N/A self N/A N/A N/A N/A N/A N/A super ClockBase self __init__ N/A N/A self _dt 0.0001 N/A N/A self _start_tick N/A self _last_tick N/A N/A self time N/A N/A self _fps 0 N/A N/A self _rfps 0 N/A N/A self _fps_counter 0 N/A N/A self _rfps_counter 0 N/A N/A self _last_fps_tick None N/A N/A self _frames 0 N/A N/A self _frames_displayed 0 N/A N/A self _events N/A N/A N/A i N/A range 256 N/A N/A self _max_fps N/A float N/A N/A Config getint graphics maxfps N/A N/A self max_iteration 10 N/A frametime N/A N/A self N/A N/A N/A Time spent between the last frame and the current frame
        (in seconds).

        .. versionadded:: 1.8.0
         N/A N/A self _dt N/A property frames N/A N/A self N/A N/A N/A Number of internal frames (not necesseraly drawed) from the start of
        the clock.

        .. versionadded:: 1.8.0
         N/A N/A self _frames N/A property frames_displayed N/A N/A self N/A N/A N/A Number of displayed frames from the start of the clock.
         N/A N/A self _frames_displayed N/A property tick N/A N/A self N/A N/A N/A Advance the clock to the next step. Must be called every frame.
        The default clock has a tick() function called by the core Kivy
        framework. N/A N/A N/A self _release_references N/A N/A N/A self _max_fps 0 N/A N/A min_sleep N/A self MIN_SLEEP N/A sleep_undershoot N/A self SLEEP_UNDERSHOOT N/A fps N/A self _max_fps N/A usleep N/A self usleep N/A sleeptime N/A N/A 1 fps N/A N/A N/A self time N/A self _last_tick N/A N/A N/A sleeptime sleep_undershoot min_sleep N/A N/A N/A usleep N/A 1000000 N/A sleeptime sleep_undershoot N/A sleeptime N/A N/A 1 fps N/A N/A N/A self time N/A self _last_tick N/A current N/A N/A self time N/A N/A self _dt N/A current N/A self _last_tick N/A N/A self _frames 1 N/A N/A self _fps_counter 1 N/A N/A self _last_tick current N/A N/A N/A self _last_fps_tick None N/A N/A N/A self _last_fps_tick current N/A N/A N/A N/A current N/A self _last_fps_tick 1 N/A N/A d N/A float N/A current N/A self _last_fps_tick N/A N/A self _fps N/A N/A self _fps_counter d N/A N/A self _rfps N/A self _rfps_counter N/A N/A self _last_fps_tick current N/A N/A self _fps_counter 0 N/A N/A self _rfps_counter 0 N/A N/A N/A self _process_events N/A N/A self _dt N/A tick_draw N/A N/A self N/A N/A N/A Tick the drawing counter.
         N/A N/A N/A self _process_events_before_frame N/A N/A self _rfps_counter 1 N/A N/A self _frames_displayed 1 N/A get_fps N/A N/A self N/A N/A N/A Get the current average FPS calculated by the clock.
         N/A N/A self _fps N/A get_rfps N/A N/A self N/A N/A N/A Get the current "real" FPS calculated by the clock.
        This counter reflects the real framerate displayed on the screen.

        In contrast to get_fps(), this function returns a counter of the
        number of frames, not the average of frames per second.
         N/A N/A self _rfps N/A get_time N/A N/A self N/A N/A N/A Get the last tick made by the clock. N/A N/A self _last_tick N/A get_boottime N/A N/A self N/A N/A N/A Get the time in seconds from the application start. N/A N/A N/A self _last_tick N/A self _start_tick N/A create_trigger N/A N/A self callback timeout N/A 0 N/A N/A Create a Trigger event. Check module documentation for more
        information.

        :returns:

            A :class:`ClockEvent` instance. To schedule the callback of this
            instance, you can call it.

        .. versionadded:: 1.0.5
         N/A ev N/A ClockEvent self False callback timeout 0 N/A _hash callback N/A N/A N/A ev release N/A ev N/A schedule_once N/A N/A self callback timeout N/A 0 N/A N/A Schedule an event in <timeout> seconds. If <timeout> is unspecified
        or 0, the callback will be called after the next frame is rendered.

        :returns:

            A :class:`ClockEvent` instance. As opposed to
            :meth:`create_trigger` which only creates the trigger event, this
            method also schedules it.

        .. versionchanged:: 1.0.5
            If the timeout is -1, the callback will be called before the next
            frame (at :meth:`tick_draw`).
         N/A N/A N/A callable callback N/A N/A N/A ValueError N/A callback must be a callable, got %s callback N/A event N/A ClockEvent self False callback timeout N/A self _last_tick N/A _hash callback True N/A event N/A schedule_interval N/A N/A self callback timeout N/A N/A N/A Schedule an event to be called every <timeout> seconds.

        :returns:

            A :class:`ClockEvent` instance. As opposed to
            :meth:`create_trigger` which only creates the trigger event, this
            method also schedules it.
         N/A N/A N/A callable callback N/A N/A N/A ValueError N/A callback must be a callable, got %s callback N/A event N/A ClockEvent self True callback timeout N/A self _last_tick N/A _hash callback True N/A event N/A unschedule N/A N/A self callback all N/A True N/A N/A Remove a previously scheduled event.

        :parameters:

            `callback`: :class:`ClockEvent` or a callable.
                If it's a :class:`ClockEvent` instance, then the callback
                associated with this event will be canceled if it is
                scheduled. If it's a callable, then the callable will be
                unscheduled if it is scheduled.
            `all`: bool
                If True and if `callback` is a callable, all instances of this
                callable will be unscheduled (i.e. if this callable was
                scheduled multiple times). Defaults to `True`.

        .. versionchanged:: 1.9.0
            The all parameter was added. Before, it behaved as if `all` was
            `True`.
         N/A N/A isinstance callback ClockEvent N/A N/A N/A N/A callback cancel N/A N/A all N/A N/A ev N/A N/A N/A self _events N/A N/A _hash callback N/A N/A N/A N/A N/A N/A ev get_callback callback N/A N/A N/A N/A ev cancel N/A N/A ev N/A N/A N/A self _events N/A N/A _hash callback N/A N/A N/A N/A N/A N/A ev get_callback callback N/A N/A N/A N/A ev cancel N/A N/A _release_references N/A N/A self N/A N/A N/A events N/A self _events N/A events N/A self _events N/A N/A event N/A events N/A N/A N/A N/A N/A event callback None N/A N/A N/A N/A event release N/A _process_events N/A N/A self N/A N/A N/A events N/A self _events N/A N/A remove N/A events remove N/A event N/A events N/A N/A N/A N/A event events N/A N/A N/A N/A event tick N/A self _last_tick remove N/A _process_events_before_frame N/A N/A self N/A N/A N/A found True N/A count N/A self max_iteration N/A events N/A self _events N/A found N/A N/A count 1 N/A N/A count -1 N/A N/A N/A N/A Logger critical Clock: Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute N/A N/A found False N/A events N/A self _events N/A N/A remove N/A events remove N/A event N/A events N/A N/A N/A N/A N/A event timeout -1 N/A N/A N/A found True N/A N/A event events N/A N/A N/A N/A event tick N/A self _last_tick remove N/A N/A time N/A staticmethod N/A partial _default_time N/A N/A N/A N/A ClockBase time __doc__ Proxy method for :func:`~kivy.compat.clock`.  mainthread N/A N/A func N/A N/A N/A Decorator that will schedule the call of the function for the next
    available frame in the mainthread. It can be useful when you use
    :class:`~kivy.network.urlrequest.UrlRequest` or when you do Thread
    programming: you cannot do any OpenGL-related work in a thread.

    Please note that this method will return directly and no result can be
    returned::

        @mainthread
        def callback(self, *args):
            print('The request succedded!',
                  'This callback is called in the main thread.')

        self.req = UrlRequest(url='http://...', on_success=callback)

    .. versionadded:: 1.8.0
     delayed_func N/A N/A N/A args kwargs N/A callback_func N/A N/A dt N/A N/A N/A N/A func args kwargs N/A N/A N/A N/A Clock schedule_once callback_func 0 N/A N/A wraps func N/A delayed_func N/A N/A N/A KIVY_DOC_INCLUDE environ N/A N/A Clock None N/A N/A Clock N/A register_context Clock ClockBase