Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evan Edmond
fslpy
Commits
c597ad19
Commit
c597ad19
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/utils/async.py
+9
-1
9 additions, 1 deletion
fsl/utils/async.py
with
9 additions
and
1 deletion
fsl/utils/async.py
+
9
−
1
View file @
c597ad19
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment