Commit 87e3982f authored by Mark Hymers's avatar Mark Hymers

Add patches

Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 3caed50d
From: Mark Hymers <mark.hymers@ynic.york.ac.uk>
Date: Sat, 27 Jul 2019 15:31:40 +0100
Subject: Change from removed get_platform API
Signed-off-by: Mark Hymers <mark.hymers@ynic.york.ac.uk>
---
psychopy/event.py | 14 +++++++-------
psychopy/visual/backends/pygletbackend.py | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/psychopy/event.py b/psychopy/event.py
index 5dd7f90..9f75be9 100644
--- a/psychopy/event.py
+++ b/psychopy/event.py
@@ -396,7 +396,7 @@ def getKeys(keyList=None, modifiers=False, timeStamped=False):
elif havePyglet:
# for each (pyglet) window, dispatch its events before checking event
# buffer
- defDisplay = pyglet.window.get_platform().get_default_display()
+ defDisplay = pyglet.canvas.get_display()
for win in defDisplay.get_windows():
try:
win.dispatch_events() # pump events on pyglet windows
@@ -507,7 +507,7 @@ def waitKeys(maxWait=float('inf'), keyList=None, modifiers=False,
while not got_keypress and timer.getTime() < maxWait:
# Pump events on pyglet windows if they exist.
if havePyglet:
- defDisplay = pyglet.window.get_platform().get_default_display()
+ defDisplay = pyglet.canvas.get_display()
for win in defDisplay.get_windows():
win.dispatch_events()
@@ -633,7 +633,7 @@ class Mouse(object):
if self.win:
w = self.win.winHandle
else:
- defDisplay = pyglet.window.get_platform().get_default_display()
+ defDisplay = pyglet.canvas.get_display()
w = defDisplay.get_windows()[0]
# get position in window
lastPosPix = numpy.array([w._mouse_x, w._mouse_y])
@@ -777,8 +777,8 @@ class Mouse(object):
if self.win: # use default window if we don't have one
w = self.win.winHandle
else:
- plat = pyglet.window.get_platform()
- w = plat.get_default_display().get_windows()[0]
+ disp = pyglet.canvas.get_display()
+ w = disp.get_windows()[0]
w.set_mouse_visible(visible)
def clickReset(self, buttons=(0, 1, 2)):
@@ -820,7 +820,7 @@ class Mouse(object):
# False: # havePyglet: # like in getKeys - pump the events
# for each (pyglet) window, dispatch its events before checking
# event buffer
- defDisplay = pyglet.window.get_platform().get_default_display()
+ defDisplay = pyglet.canvas.get_display()
for win in defDisplay.get_windows():
win.dispatch_events() # pump events on pyglet windows
@@ -926,7 +926,7 @@ def clearEvents(eventType=None):
if not havePygame or not display.get_init(): # pyglet
# For each window, dispatch its events before
# checking event buffer.
- defDisplay = pyglet.window.get_platform().get_default_display()
+ defDisplay = pyglet.canvas.get_display()
for win in defDisplay.get_windows():
win.dispatch_events() # pump events on pyglet windows
diff --git a/psychopy/visual/backends/pygletbackend.py b/psychopy/visual/backends/pygletbackend.py
index cddc2d6..1ddc80c 100644
--- a/psychopy/visual/backends/pygletbackend.py
+++ b/psychopy/visual/backends/pygletbackend.py
@@ -98,7 +98,7 @@ class PygletBackend(BaseBackend):
stereo=win.stereo,
vsync=vsync)
- defDisp = pyglet.window.get_platform().get_default_display()
+ defDisp = pyglet.canvas.get_display()
allScrs = defDisp.get_screens()
# Screen (from Exp Settings) is 1-indexed,
# so the second screen is Screen 1
@@ -298,7 +298,7 @@ class PygletBackend(BaseBackend):
:return:
"""
- wins = pyglet.window.get_platform().get_default_display().get_windows()
+ wins = pyglet.canvas.get_display().get_windows()
for win in wins:
win.dispatch_events()
From: Mark Hymers <mark.hymers@ynic.york.ac.uk>
Date: Sat, 27 Jul 2019 15:32:12 +0100
Subject: Remove python3 warning about importing ABCs from collections
Signed-off-by: Mark Hymers <mark.hymers@ynic.york.ac.uk>
---
psychopy/event.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/psychopy/event.py b/psychopy/event.py
index 9f75be9..9199f08 100644
--- a/psychopy/event.py
+++ b/psychopy/event.py
@@ -20,7 +20,11 @@ import sys
import string
import copy
import numpy
-from collections import namedtuple, OrderedDict, MutableMapping
+from collections import namedtuple, OrderedDict
+try:
+ from collections.abc import MutableMapping
+except ImportError:
+ from collections import MutableMapping
from psychopy.preferences import prefs
# try to import pyglet & pygame and hope the user has at least one of them!
From: Mark Hymers <mark.hymers@ynic.york.ac.uk>
Date: Sat, 27 Jul 2019 15:32:25 +0100
Subject: Stop using deprecated pytest pytest_namespace feature
Signed-off-by: Mark Hymers <mark.hymers@ynic.york.ac.uk>
---
psychopy/tests/conftest.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/psychopy/tests/conftest.py b/psychopy/tests/conftest.py
index 1c467da..ebb1375 100644
--- a/psychopy/tests/conftest.py
+++ b/psychopy/tests/conftest.py
@@ -4,11 +4,9 @@
import pytest
from psychopy.app._psychopyApp import PsychoPyApp
-@pytest.fixture(scope="session", autouse=True)
-def pytest_namespace():
+def pytest_configure():
app = PsychoPyApp(testMode=True, showSplash=False)
- return {'app': app}
+ pytest.app = app
-@pytest.mark.usefixtures('pytest_namespace')
def pytest_sessionfinish(session, exitstatus):
pytest.app.quit()
0001-Change-from-removed-get_platform-API.patch
0002-Remove-python3-warning-about-importing-ABCs-from-col.patch
0003-Stop-using-deprecated-pytest-pytest_namespace-featur.patch
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