[Pkg-bitcoin-commits] [python-quamash] 01/78: Change how event loop base classes are assigned.
Jonas Smedegaard
dr at jones.dk
Tue Dec 19 01:19:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.6.0_dfsg-1
in repository python-quamash.
commit 8e5a6e87b726cf33440cc49f7387e414876bec8e
Author: Mark Harviston <Mark.T.Harviston.-ND at disney.com>
Date: Thu Jan 14 12:36:20 2016 -0800
Change how event loop base classes are assigned.
This lets you use the SelectorEventLoop on windows.
---
quamash/__init__.py | 20 ++++++++++++--------
quamash/_unix.py | 2 --
quamash/_windows.py | 3 ---
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/quamash/__init__.py b/quamash/__init__.py
index c0f9b4f..1a3f90a 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -169,16 +169,9 @@ def _make_signaller(qtimpl_qtcore, *args):
signal = qtimpl_qtcore.pyqtSignal(*args)
return Signaller()
-if os.name == 'nt':
- from . import _windows
- _baseclass = _windows.baseclass
-else:
- from . import _unix
- _baseclass = _unix.baseclass
-
@with_logger
-class QEventLoop(_baseclass):
+class _QEventLoop(asyncio.BaseEventLoop):
"""
Implementation of asyncio event loop that uses the Qt Event loop.
@@ -567,6 +560,17 @@ class QEventLoop(_baseclass):
except:
sys.stderr.write('{!r}, {!r}\n'.format(args, kwds))
+from .unix import _SelectorEventLoop
+class QSelectorEventLoop(_QEventLoop, _SelectorEventLoop):
+ pass
+
+if os.name == 'nt':
+ from ._windows import _ProactorEventLoop
+ class QIOCPEventLoop(_QEventLoop, _ProactorEventLoop):
+ pass
+ QEventLoop = QIOCPEventLoop
+else:
+ QEventLoop = QSelectorEventLoop
class _Cancellable:
def __init__(self, timer, loop):
diff --git a/quamash/_unix.py b/quamash/_unix.py
index fafed92..8655a0c 100644
--- a/quamash/_unix.py
+++ b/quamash/_unix.py
@@ -216,5 +216,3 @@ class _SelectorEventLoop(asyncio.SelectorEventLoop):
else:
self._logger.debug('Invoking writer callback: {}'.format(writer))
writer._run()
-
-baseclass = _SelectorEventLoop
diff --git a/quamash/_windows.py b/quamash/_windows.py
index fb586ef..a474161 100644
--- a/quamash/_windows.py
+++ b/quamash/_windows.py
@@ -52,9 +52,6 @@ class _ProactorEventLoop(asyncio.ProactorEventLoop):
self.__event_poller.stop()
-baseclass = _ProactorEventLoop
-
-
@with_logger
class _IocpProactor(windows_events.IocpProactor):
def __init__(self):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git
More information about the Pkg-bitcoin-commits
mailing list