Commit bef96d26 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'v1.0' into 'v1.0'

Version 1.0.3

See merge request !25
parents e878aaac ceb6f081
Pipeline #736 passed with stages
in 2 minutes and 17 seconds
...@@ -320,6 +320,7 @@ build-doc: ...@@ -320,6 +320,7 @@ build-doc:
- python setup.py doc - python setup.py doc
- mv doc/html doc/"$CI_COMMIT_REF_NAME" - mv doc/html doc/"$CI_COMMIT_REF_NAME"
artifacts: artifacts:
expire_in: 1 day
paths: paths:
- doc/$CI_COMMIT_REF_NAME - doc/$CI_COMMIT_REF_NAME
...@@ -335,7 +336,7 @@ build-dist: ...@@ -335,7 +336,7 @@ build-dist:
stage: build stage: build
image: python:3.5 image: python:3.5
tags: tags:
- docker - docker
...@@ -345,6 +346,7 @@ build-dist: ...@@ -345,6 +346,7 @@ build-dist:
- python setup.py bdist_wheel - python setup.py bdist_wheel
artifacts: artifacts:
expire_in: 1 day
paths: paths:
- dist/* - dist/*
......
...@@ -77,13 +77,11 @@ Other facilities ...@@ -77,13 +77,11 @@ Other facilities
The ``async`` module also defines the :func:`mutex` decorator, which is The ``async`` module also defines the :func:`mutex` decorator, which is
intended to be used to mark the methods of a class as being mutually exclusive. intended to be used to mark the methods of a class as being mutually exclusive.
The ``mutex`` decorator uses the :class:`MutexFactory` class to do its work. The ``mutex`` decorator uses the :class:`MutexFactory` class to do its work.
.. todo:: You could possibly use ``props.callqueue`` to drive the idle loop.
""" """
import time import time
import atexit
import logging import logging
import functools import functools
import threading import threading
...@@ -213,6 +211,9 @@ def idleReset(): ...@@ -213,6 +211,9 @@ def idleReset():
global _idleTimer global _idleTimer
global _idleCallRate global _idleCallRate
if _idleTimer is not None:
_idleTimer.Stop()
_idleRegistered = False _idleRegistered = False
_idleQueue = queue.Queue() _idleQueue = queue.Queue()
_idleQueueDict = {} _idleQueueDict = {}
...@@ -220,6 +221,11 @@ def idleReset(): ...@@ -220,6 +221,11 @@ def idleReset():
_idleCallRate = 200 _idleCallRate = 200
# Call idleReset on exit, in
# case the idleTimer is active.
atexit.register(idleReset)
def getIdleTimeout(): def getIdleTimeout():
"""Returns the current ``wx`` idle loop time out/call rate. """Returns the current ``wx`` idle loop time out/call rate.
""" """
...@@ -306,7 +312,7 @@ def _wxIdleLoop(ev): ...@@ -306,7 +312,7 @@ def _wxIdleLoop(ev):
if taskName is None: taskName = funcName if taskName is None: taskName = funcName
else: taskName = '{} [{}]'.format(taskName, funcName) else: taskName = '{} [{}]'.format(taskName, funcName)
# Has enouggh time elapsed # Has enough time elapsed
# since the task was scheduled? # since the task was scheduled?
# If not, re-queue the task. # If not, re-queue the task.
# If this is the only task on the # If this is the only task on the
...@@ -333,8 +339,15 @@ def _wxIdleLoop(ev): ...@@ -333,8 +339,15 @@ def _wxIdleLoop(ev):
try: _idleQueueDict.pop(task.name) try: _idleQueueDict.pop(task.name)
except KeyError: pass except KeyError: pass
# More tasks on the queue?
# Request anotherd event
if _idleQueue.qsize() > queueSizeOffset: if _idleQueue.qsize() > queueSizeOffset:
ev.RequestMore() ev.RequestMore()
# Otherwise use the idle
# timer to make sure that
# the loop keeps ticking
# over
else: else:
_idleTimer.Start(_idleCallRate, wx.TIMER_ONE_SHOT) _idleTimer.Start(_idleCallRate, wx.TIMER_ONE_SHOT)
......
...@@ -41,7 +41,7 @@ import re ...@@ -41,7 +41,7 @@ import re
import string import string
__version__ = '1.0.2' __version__ = '1.0.3'
"""Current version number, as a string. """ """Current version number, as a string. """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment