Skip to content
Snippets Groups Projects
Commit c597ad19 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

async.idle can be forced to queue a task even if wx.MainLoop is not running.

parent c1b79f4a
No related branches found
No related tags found
No related merge requests found
......@@ -304,6 +304,13 @@ def idle(task, *args, **kwargs):
``name`` is already enqueud, (or is running), the
function is not called. Defaults to ``False``.
:arg alwaysQueue: Optional. If provided, must be provided as a keyword
argument. If ``True``, and a ``wx.MainLoop`` is not
running, the task is enqueued anyway, under the
assumption that a ``wx.MainLoop`` will be started in
the future.
All other arguments are passed through to the task function.
......@@ -333,8 +340,9 @@ def idle(task, *args, **kwargs):
after = kwargs.pop('after', 0)
name = kwargs.pop('name', None)
skipIfQueued = kwargs.pop('skipIfQueued', None)
alwaysQueue = kwargs.pop('alwaysQueue', False)
if _haveWX():
if alwaysQueue or _haveWX():
import wx
if not _idleRegistered:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment