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

Merge branch 'mnt/idle_testing' into 'master'

Mnt/idle testing

See merge request fsl/fslpy!168
parents 8d7d19a9 8a840cff
No related branches found
No related tags found
No related merge requests found
Pipeline #4580 passed
......@@ -2,6 +2,21 @@ This document contains the ``fslpy`` release history in reverse chronological
order.
2.6.2 (Monday 7th October 2019)
-------------------------------
Changed
^^^^^^^
* Added a debugging hook in the :mod:`.idle` module.
* The :func:`.fslsub.submit` function is now more flexible in the way it
accepts the command and input arguments.
* The :func:`.run.prepareArgs` function has been renamed (from
``_prepareArgs``).
2.6.1 (Thursday 19th September 2019)
------------------------------------
......
......@@ -62,7 +62,7 @@ copyright = u'{}, Paul McCarthy, University of Oxford, Oxford, UK'.format(
# Links to other things
rst_epilog = """
.. |fsleyes_apidoc| replace:: FSLeyes
.. _fsleyes_apidoc: http://users.fmrib.ox.ac.uk/~paulmc/fsleyes_apidoc/index.html
.. _fsleyes_apidoc: http://users.fmrib.ox.ac.uk/~paulmc/fsleyes/userdoc/latest/index.html
"""
......
......@@ -4,7 +4,23 @@
The ``fslpy`` package is a collection of utilities and data abstractions used
by |fsleyes_apidoc|_.
within `FSL <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki>`_ and by
|fsleyes_apidoc|_.
The top-level Python package for ``fslpy`` is called ``fsl``. It is broadly
split into the following sub-packages:
.. autosummary::
fsl.data
fsl.utils
fsl.scripts
fsl.transform
fsl.version
fsl.wrappers
.. toctree::
:hidden:
......
......@@ -196,6 +196,13 @@ _idleCallRate = 200
"""
_idleAllowErrors = False
"""Used for testing/debugging. If ``True``, and a function called on the idle
loop raises an error, that error will not be caught, and the idle loop will
stop.
"""
def idleReset():
"""Reset the internal :func:`idle` queue state.
......@@ -211,6 +218,7 @@ def idleReset():
global _idleQueueDict
global _idleTimer
global _idleCallRate
global _idleAllowErrors
if _idleTimer is not None:
_idleTimer.Stop()
......@@ -221,11 +229,12 @@ def idleReset():
if queue is not None: newQueue = queue.Queue()
else: newQueue = None
_idleRegistered = False
_idleQueue = newQueue
_idleQueueDict = {}
_idleTimer = None
_idleCallRate = 200
_idleRegistered = False
_idleQueue = newQueue
_idleQueueDict = {}
_idleTimer = None
_idleCallRate = 200
_idleAllowErrors = False
# Call idleReset on exit, in
......@@ -294,6 +303,7 @@ def _wxIdleLoop(ev):
global _idleQueueDict
global _idleTimer
global _idleCallRate
global _idleAllowErrors
ev.Skip()
......@@ -342,6 +352,9 @@ def _wxIdleLoop(ev):
log.warning('Idle task {} crashed - {}: {}'.format(
taskName, type(e).__name__, str(e)), exc_info=True)
if _idleAllowErrors:
raise e
if task.name is not None:
try: _idleQueueDict.pop(task.name)
except KeyError: pass
......
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