Hello community,

here is the log from the commit of package python-pyglet for openSUSE:Leap:15.2 
checked in at 2020-03-02 13:20:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-pyglet (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-pyglet.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pyglet"

Mon Mar  2 13:20:53 2020 rev:15 rq:776975 version:1.3.2

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-pyglet/python-pyglet.changes    
2020-01-15 15:51:58.171547217 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.python-pyglet.new.26092/python-pyglet.changes 
2020-03-02 13:20:54.890107046 +0100
@@ -1,0 +2,36 @@
+Sun Sep 15 07:07:32 UTC 2019 - John Vandenberg <[email protected]>
+
+- Use %python_expand in %check to allow building only one flavour
+
+-------------------------------------------------------------------
+Wed Mar 20 13:34:05 UTC 2019 - John Vandenberg <[email protected]>
+
+- Reactivate test suite, except for platforms ppc and s390 which
+  regularly run out of memory while loading libraries
+- De-vendor python-future
+- Add MIT to License: and %license due to vendored pypng, using
+  pypng-license.patch
+- Remove macos and win32 platform support
+- Add missing runtime dependency libxcb-glx0 and add several
+  runtime recommended dependencies
+- Remove incorrect runtime dependencies
+- Remove unused build dependencies
+- Fix fdupes and permissions of examples
+
+-------------------------------------------------------------------
+Tue Dec  4 12:52:16 UTC 2018 - Matej Cepl <[email protected]>
+
+- Remove superfluous devel dependency for noarch package
+
+-------------------------------------------------------------------
+Thu Jun 14 13:35:30 UTC 2018 - [email protected]
+
+- Update to version 1.3.2
+  * #158 Fix mouse events in mouse exclusive mode on Windows.
+  * #105 Crashes in PulseAudio;
+  * #163 Workaround for running inside Spyder;
+  * #45  Expose viewport size for use on HiDPI screens;
+  * #15  Respect keyboard layout on macOS;
+- Remove broken tests
+
+-------------------------------------------------------------------

Old:
----
  pyglet-1.3.1.tar.gz

New:
----
  pyglet-1.3.2.tar.gz
  pypng-license.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pyglet.spec ++++++
--- /var/tmp/diff_new_pack.zHLav7/_old  2020-03-02 13:20:55.418108093 +0100
+++ /var/tmp/diff_new_pack.zHLav7/_new  2020-03-02 13:20:55.418108093 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pyglet
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,56 +12,93 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
+%define         X_display         :98
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%define         X_display         ":98"
-# TODO: Can't get display working with glx
+
+%bcond_with     pytest_helpers
+
+%ifarch %{arm} aarch64 x86_64 %{ix86} ppc64le
+%bcond_without  gtk2
+%bcond_without  test
+# test_worker_refill_multiple_players_refill_multiple failed once on armv7l
+%else
+# s390x fails without out of memory with gtk and freetype,
+# even with 8G memory from _constraints
+# ppc has lots of similar problems, especially with gdk
 %bcond_with     test
+%bcond_with     gtk2
+%endif
+
+# Set _version to 1.4 for 1.4.0betas and hg default
+%define _version 1.3.2
 Name:           python-pyglet
-Version:        1.3.1
+Version:        1.3.2
 Release:        0
 Summary:        Windowing and multimedia library
-License:        BSD-3-Clause
+# 1.3.2 contains a vendored old pypng
+License:        BSD-3-Clause AND MIT
 Group:          Development/Languages/Python
-Url:            https://bitbucket.org/pyglet/pyglet
+URL:            https://bitbucket.org/pyglet/pyglet
 Source0:        
https://files.pythonhosted.org/packages/source/p/pyglet/pyglet-%{version}.tar.gz
 Source1:        %{name}-rpmlintrc
 # PATCH-FIX-OPENSUSE pyglet-1.2.4-fix-image-import.patch -- fix "import Image"
 Patch0:         pyglet-1.2.4-fix-image-import.patch
-BuildRequires:  %{python_module Pillow}
-BuildRequires:  %{python_module devel}
+%if "%{_version}" == "1.3.2"
+Patch1:         pypng-license.patch
+%endif
 BuildRequires:  %{python_module setuptools}
-BuildRequires:  alsa-devel
 BuildRequires:  dos2unix
 BuildRequires:  fdupes
-BuildRequires:  fontconfig-devel
-BuildRequires:  freetype2-devel
-BuildRequires:  gtk2-devel
-BuildRequires:  openal-soft-devel
 BuildRequires:  python-rpm-macros
-BuildRequires:  pkgconfig(gl)
-BuildRequires:  pkgconfig(glu)
-BuildRequires:  pkgconfig(x11)
+Requires:       Mesa-dri
+Requires:       config(Mesa)
+Requires:       python-Pillow
+Requires:       python-future
+Requires:       libxcb-glx0
+%if "%{_version}" == "1.4"
+Requires:       python-pypng
+%endif
+Recommends:     alsa-lib
+Recommends:     fontconfig
+Recommends:     freetype
+Recommends:     libGLU1
+Recommends:     libopenal0
+%if %{with gtk2}
+Recommends:     gtk2
+%endif
+BuildArch:      noarch
 %if %{with test}
+BuildRequires:  %{python_module Pillow}
+BuildRequires:  %{python_module future}
+BuildRequires:  %{python_module mock}
 BuildRequires:  %{python_module pytest}
-BuildRequires:  config(Mesa)
+BuildRequires:  Mesa-dri
+BuildRequires:  alsa-lib
+BuildRequires:  fontconfig
+BuildRequires:  freetype
+BuildRequires:  gnu-free-fonts
+BuildRequires:  libopenal0
 BuildRequires:  xorg-x11-server
+BuildRequires:  config(Mesa)
+BuildRequires:  pkgconfig(gl)
+BuildRequires:  pkgconfig(glu)
+BuildRequires:  pkgconfig(libpulse)
+BuildRequires:  pkgconfig(x11)
+BuildRequires:  pkgconfig(xcb-glx)
+%if %{with gtk2}
+BuildRequires:  gtk2
+%endif
+%if %{with pytest_helpers}
+BuildRequires:  %{python_module pytest-error-for-skips}
+BuildRequires:  %{python_module pytest-instafail}
+BuildRequires:  %{python_module pytest-timeout}
+%endif
+# endif test
 %endif
-Requires:       alsa-devel
-Requires:       fontconfig-devel
-Requires:       freetype2-devel
-Requires:       gtk2-devel
-Requires:       openal-soft-devel
-Requires:       python-Pillow
-Requires:       config(Mesa)
-Requires:       pkgconfig(gl)
-Requires:       pkgconfig(glu)
-Requires:       pkgconfig(x11)
-BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -71,23 +108,139 @@
 %prep
 %setup -q -n pyglet-%{version}
 %patch0
+%if "%{_version}" == "1.3.2"
+%patch1 -p1
+%endif
+
 # Can't be used for commercial purposes
 rm -r examples/noisy/
 
-# Convert to unix line end
-find -name "*.py" -exec dos2unix "{}" "+"
+# Not needed, and interferes with test discovery
+rm -r pyglet/extlibs/future/
+rm -r tests/extlibs/future/ tests/extlibs/mock.py
+
+# Windows only, and is a vendored module
+rm pyglet/font/win32*.py examples/font_comparison.py
+
+%if "%{_version}" == "1.4"
+# De-vendoring pypng-ing results in failures in v1.3.2, as it is using pypng 
an earlier pypng:
+# AttributeError: 'module' object has no attribute 'Writer'
+# pyglet 1.4 is using the latest pypng 0.0.19, the same version as 
python-pypng package
+rm pyglet/extlibs/png.py
+sed -i 's/import pyglet.extlibs.png as pypng/import png as pypng/' 
pyglet/image/codecs/png.py
+%endif
+
+# Files unneccessary for Linux runtimes
+rm -r \
+%if "%{_version}" == "1.3.2"
+  pyglet/*/carbon.py pyglet/input/carbon_*.py pyglet/window/carbon/ 
pyglet/image/codecs/quicktime.py tests/unit/test_osx.py \
+%endif
+  pyglet/gl/lib_agl.py pyglet/gl/lib_wgl.py pyglet/gl/wgl*.py \
+  pyglet/*/cocoa.py pyglet/*/quartz.py pyglet/*/win32.py \
+  pyglet/input/darwin_hid.py pyglet/input/directinput.py 
pyglet/input/wintab.py \
+  pyglet/image/codecs/quartz.py pyglet/image/codecs/gdiplus.py \
+  pyglet/window/cocoa/ pyglet/window/win32/ \
+  pyglet/libs/darwin/ pyglet/libs/win32/ \
+  pyglet/media/drivers/directsound/ 
tests/integration/media/test_directsound.py \
+  tests/integration/platform/test_win_multicore_clock.py
+
+%if %{without gtk2}
+# Disable GdkPixbuf
+sed -i 's/^\( *\).*gdkpixbuf2.*/\1pass/' pyglet/image/codecs/__init__.py
+%endif
+
+# Allow invocation using unittest discover -vv --start-directory tests/xyz/
+# 
https://bitbucket.org/pyglet/pyglet/issues/231/allow-invocation-using-unittest-discover
+sed -i 's/from \.\.\./from tests./' \
+%if "%{_version}" == "1.3.2"
+  tests/interactive/window/test_window_multisample.py \
+%endif
+%if "%{_version}" == "1.4"
+  tests/unit/media/test_listener.py \
+%endif
+  tests/integration/image/test_gdkpixbuf2.py \
+  tests/interactive/image/test_image.py
+
+# Fails with Arial and FreeSerif, Bitstream Vera Sans and Courier
+# 
https://bitbucket.org/pyglet/pyglet/issues/245/bitstream-vera-sans-bold-and-italic-font
+sed -i 's/test_find_font_match_bold/_test_find_font_match_bold/' 
tests/integration/platform/test_linux_fontconfig.py
+
+# Tests rely on Arial font, however webcore-fonts is not OSS, and 
fetchmsttfonts
+# only includes the script.  Use gnu-free-fonts instead.
+# 
https://bitbucket.org/pyglet/pyglet/issues/230/use-a-free-er-font-in-test-suite
+sed -i 's/arial/freeserif/g;s/Arial/FreeSerif/g' \
+  tests/unit/test_text.py \
+  tests/integration/platform/test_linux_fontconfig.py \
+  tests/integration/font/*.py \
+  tests/interactive/font/*.py
+
+## Unit tests
+
+# Convert to a mark, so it can be deselected, bypassing error-for-skips
+sed -i "s/@unittest.skip('Requires changes to events from fork by 
Leif')/@pytest.mark.leif_fork/" tests/unit/test_events.py
+sed -i 's/import unittest/import unittest, pytest/' tests/unit/test_events.py
+
+%if "%{_version}" == "1.3.2"
+# 
https://bitbucket.org/pyglet/pyglet/issues/224/mediatest_playerplayertestcasetest_delete
+sed -i 's/test_delete/_test_delete/' tests/unit/media/test_player.py
+%endif
+
+# https://bitbucket.org/pyglet/pyglet/issues/223/clock-test-failures
+# Occasional errors on all platforms, and test_clock.py fails on Python 2 only
+rm tests/unit/test_clock_fps.py
+
+## Integration tests
+
+# Test fails on all platforms
+#sed -i 's/test_unreferenced_cleanup/_test_unreferenced_cleanup/' 
tests/integration/media/test_player.py
+
+# test_driver: AssertionError: Cannot load audio driver for your platform
+# test_openal: OpenALException: OpenAL Exception [40965: Out of Memory]: 
Failed to open device.
+# Similar for pulse, and hang in player
+rm -f tests/integration/media/test_driver.py \
+  tests/integration/media/test_player.py \
+  tests/integration/media/test_openal.py \
+  tests/integration/media/test_pulse.py
+
+# test_immediate_drawing*, test_immediate_drawing and multitexture fails
+# except on Tumbleweed
+rm -f tests/integration/graphics/test_retained_drawing*.py \
+  tests/integration/graphics/test_immediate_drawing*.py \
+  tests/integration/graphics/test_multitexture.py
+
+## Interactive tests
+
+# Fix missing interactive_test_base
+# See 
https://bitbucket.org/pyglet/pyglet/issues/234/interactive_test_base-is-missing
+sed -i '/interactive_test_base/d' tests/run.py tests/interactive/__init__.py
+rm tests/base/test_interactive_test_base.py
+
+# Final tidy up
+
+# Only useful to creates Windows or MacOS apps
+rm examples/astraea/setup.py
+
+# Convert to unix line endings
+find pyglet -name "*.py" -exec dos2unix "{}" "+"
+
+chmod a+x examples/synthesizer.py examples/soundspace/soundspace.py 
examples/game/version*/asteroid.py
+
+dos2unix examples/opengl_3.py examples/tablet.py
 
 %build
 %python_build
 
 %install
 %python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
 
-%{python_expand cp -Lr examples examples_%{$python_bin_suffix}
-find examples_%{$python_bin_suffix} -name "*.py" -exec sed -i 
"s|^#!/usr/bin/python$|#!%{__$python}|" {} \;
-find examples_%{$python_bin_suffix} -name "*.py" -exec sed -i 
"s|^#!/usr/bin/env python$|#!%{__$python}|" {} \;
-%fdupes examples_%{$python_bin_suffix}
-%fdupes %{buildroot}%{$python_sitelib}
+%{python_expand pkgdocdir=%{_docdir}/$(cat _current_flavor)-pyglet
+mkdir -p %{buildroot}$pkgdocdir
+cp -Lr examples/ %{buildroot}$pkgdocdir/
+find %{buildroot}$pkgdocdir/examples/ -name "*.py" -exec sed -i 
"s|^#!%{_bindir}/python$|#!%{__$python}|" {} \;
+find %{buildroot}$pkgdocdir/examples/ -name "*.py" -exec sed -i 
"s|^#!%{_bindir}/env python$|#!%{__$python}|" {} \;
+
+%fdupes %{buildroot}$pkgdocdir/examples/
 }
 
 %if %{with test}
@@ -96,16 +249,57 @@
 ### Launch a virtual framebuffer X server ###
 #############################################
 export DISPLAY=%{X_display}
- vfb %{X_display} >& Xvfb.log &
+Xvfb +iglx %{X_display} -screen 0 1600x1200x16 &
 trap "kill $! || true" EXIT
-sleep 10
-%python_expand py.test-%{$python_bin_suffix}
+sleep 5
+
+# This is to allow use of pytest-error-for-skips and pytest-instafail,
+# used to see problems even when tests hang.
+# test_multiple_start_stop is occasional failures on most platforms
+pytest_k_list="test_openal or test_pulse or test_arb or \
+  test_multitexture or test_clock or test_get_animation_no_video or \
+  leif_fork or test_load_privatefont or test_load_privatefont_from_list or 
test_directsound_listener or \
+  test_gdiplus_loading or test_quartz_loading or test_quicktime_loading or 
test_multiple_start_stop"
+
+%if %{without gtk2}
+pytest_k_list="$pytest_k_list or test_gdkpixbuf2 or test_gdkpixbuf2_loading"
+%endif
+
+%if %{with pytest_helpers}
+pytest_addopts="--instafail --error-for-skips --timeout=30 "
+%endif
+
+pytest_addopts="$pytest_addopts tests/unit tests/integration"
+
+%{python_expand  #
+# These are only problematic on Python 2, and are restored after Python 2 tests
+# https://bitbucket.org/pyglet/pyglet/issues/223/clock-test-failures
+if [ $python = python2 ]; then
+  mv tests/unit/test_clock.py tests/unit/.test_clock.py
+fi
+
+$python -m pytest $pytest_addopts -k "not ($pytest_k_list)"
+
+if [ -x tests/unit/.test_clock.py ]; then
+  mv tests/unit/.test_clock.py tests/unit/test_clock.py
+fi
+}
+
+# endif test
 %endif
 
 %files %{python_files}
-%defattr(-,root,root,-)
-%doc LICENSE NOTICE README RELEASE_NOTES
-%doc examples_%{python_bin_suffix}
+%license LICENSE
+%if "%{_version}" == "1.3.2"
+%license LICENSE.pypng
+%endif
+%doc NOTICE README RELEASE_NOTES
+%ifpython2
+%{_defaultdocdir}/python{,2}-pyglet/examples/
+%endif
+%ifpython3
+%{_defaultdocdir}/python3-pyglet/examples/
+%endif
 %{python_sitelib}/pyglet
 %{python_sitelib}/pyglet-%{version}-py*.egg-info
 

++++++ pyglet-1.3.1.tar.gz -> pyglet-1.3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/PKG-INFO new/pyglet-1.3.2/PKG-INFO
--- old/pyglet-1.3.1/PKG-INFO   2018-02-05 15:04:31.000000000 +0100
+++ new/pyglet-1.3.2/PKG-INFO   2018-04-13 16:55:08.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pyglet
-Version: 1.3.1
+Version: 1.3.2
 Summary: Cross-platform windowing and multimedia library
 Home-page: http://pyglet.readthedocs.org/en/latest/
 Author: Alex Holkner
@@ -26,5 +26,6 @@
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
 Classifier: Topic :: Games/Entertainment
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/RELEASE_NOTES 
new/pyglet-1.3.2/RELEASE_NOTES
--- old/pyglet-1.3.1/RELEASE_NOTES      2018-02-05 15:03:53.000000000 +0100
+++ new/pyglet-1.3.2/RELEASE_NOTES      2018-04-13 16:54:45.000000000 +0200
@@ -1,3 +1,16 @@
+Pyglet 1.3.2
+============
+Bugfix release.
+
+Bugfixes
+--------
+- #154 Caret issues.
+- #158 Additional fixes.
+- #167 IndexedVertexDomains with non-1 primcount will now draw correctly on 
64bit OSs.
+- #168 Compatibility with python 3.7.
+- #169 [Windows] window.flip too slow.
+- #170 NameError: name 'PUINT' is not defined.
+
 Pyglet 1.3.1
 ============
 Bugfix release.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/examples/text_input.py 
new/pyglet-1.3.2/examples/text_input.py
--- old/pyglet-1.3.1/examples/text_input.py     2018-02-05 15:03:40.000000000 
+0100
+++ new/pyglet-1.3.2/examples/text_input.py     2018-04-13 16:54:45.000000000 
+0200
@@ -132,6 +132,9 @@
             pyglet.app.exit()
         
     def set_focus(self, focus):
+        if focus is self.focus:
+            return
+
         if self.focus:
             self.focus.caret.visible = False
             self.focus.caret.mark = self.focus.caret.position = 0
@@ -139,8 +142,6 @@
         self.focus = focus
         if self.focus:
             self.focus.caret.visible = True
-            self.focus.caret.mark = 0
-            self.focus.caret.position = len(self.focus.document.text)
 
 window = Window(resizable=True)
 pyglet.app.run()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/__init__.py 
new/pyglet-1.3.2/pyglet/__init__.py
--- old/pyglet-1.3.1/pyglet/__init__.py 2018-02-05 15:03:53.000000000 +0100
+++ new/pyglet-1.3.2/pyglet/__init__.py 2018-04-13 16:54:45.000000000 +0200
@@ -81,7 +81,7 @@
 #:    >>> parse_version(pyglet.version) >= parse_version('1.1')
 #:    True
 #:
-version = '1.3.1'
+version = '1.3.2'
 
 # Pyglet platform treats *BSD systems as Linux
 compat_platform = sys.platform
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/gl/win32.py 
new/pyglet-1.3.2/pyglet/gl/win32.py
--- old/pyglet-1.3.1/pyglet/gl/win32.py 2018-02-05 15:03:40.000000000 +0100
+++ new/pyglet-1.3.2/pyglet/gl/win32.py 2018-04-13 16:54:33.000000000 +0200
@@ -223,7 +223,7 @@
         super(Win32Context, self).detach()
 
     def flip(self):
-        wgl.wglSwapLayerBuffers(self.canvas.hdc, wgl.WGL_SWAP_MAIN_PLANE)
+        _gdi32.SwapBuffers(self.canvas.hdc)
 
     def get_vsync(self):
         if wgl_info.have_extension('WGL_EXT_swap_control'):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/graphics/vertexdomain.py 
new/pyglet-1.3.2/pyglet/graphics/vertexdomain.py
--- old/pyglet-1.3.1/pyglet/graphics/vertexdomain.py    2018-02-05 
15:03:40.000000000 +0100
+++ new/pyglet-1.3.2/pyglet/graphics/vertexdomain.py    2018-04-13 
16:54:45.000000000 +0200
@@ -749,10 +749,9 @@
                     self.index_buffer.ptr + starts[0])
             elif gl_info.have_version(1, 4):
                 starts = [s * self.index_element_size + self.index_buffer.ptr 
for s in starts]
-                starts = ctypes.cast((GLuint * primcount)(*starts), 
ctypes.POINTER(ctypes.c_void_p))
+                starts = (ctypes.POINTER(GLvoid) * primcount)(*(GLintptr * 
primcount)(*starts))
                 sizes = (GLsizei * primcount)(*sizes)
-                glMultiDrawElements(mode, sizes, GL_UNSIGNED_INT, starts,
-                                    primcount)
+                glMultiDrawElements(mode, sizes, self.index_gl_type, starts, 
primcount)
             else:
                 for start, size in zip(starts, sizes):
                     glDrawElements(mode, size, self.index_gl_type,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/libs/win32/__init__.py 
new/pyglet-1.3.2/pyglet/libs/win32/__init__.py
--- old/pyglet-1.3.1/pyglet/libs/win32/__init__.py      2018-02-05 
15:03:53.000000000 +0100
+++ new/pyglet-1.3.2/pyglet/libs/win32/__init__.py      2018-04-13 
16:54:45.000000000 +0200
@@ -26,12 +26,12 @@
     def format_error(err):
         msg = create_string_buffer(256)
         _FormatMessageA(constants.FORMAT_MESSAGE_FROM_SYSTEM,
-                          c_void_p(),
-                          err,
-                          0,
-                          msg,
-                          len(msg),
-                          c_void_p())
+                        c_void_p(),
+                        err,
+                        0,
+                        msg,
+                        len(msg),
+                        c_void_p())
         return msg.value
     
     class DebugLibrary(object):
@@ -40,6 +40,7 @@
 
         def __getattr__(self, name):
             fn = getattr(self.lib, name)
+
             def f(*args):
                 _SetLastError(0)
                 result = fn(*args)
@@ -49,6 +50,7 @@
                         _log_win32.write(entry)
                     print(format_error(err), file=_log_win32)
                 return result
+
             return f
 else:
     DebugLibrary = lambda lib: lib
@@ -101,6 +103,8 @@
 _gdi32.SetPixelFormat.argtypes = [HDC, c_int, POINTER(PIXELFORMATDESCRIPTOR)]
 _gdi32.SetTextColor.restype = COLORREF
 _gdi32.SetTextColor.argtypes = [HDC, COLORREF]
+_gdi32.SwapBuffers.restype = BOOL
+_gdi32.SwapBuffers.argtypes = [HDC]
 
 _kernel32.CloseHandle.restype = BOOL
 _kernel32.CloseHandle.argtypes = [HANDLE]
@@ -230,7 +234,7 @@
 _user32.UnregisterClassW.argtypes = [c_wchar_p, HINSTANCE]
 _user32.UnregisterHotKey.restype = BOOL
 _user32.UnregisterHotKey.argtypes = [HWND, c_int]
-#Raw inputs
+# Raw inputs
 _user32.RegisterRawInputDevices.restype = BOOL
 _user32.RegisterRawInputDevices.argtypes = [PCRAWINPUTDEVICE, UINT, UINT]
 _user32.GetRawInputData.restype = UINT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/libs/win32/types.py 
new/pyglet-1.3.2/pyglet/libs/win32/types.py
--- old/pyglet-1.3.1/pyglet/libs/win32/types.py 2018-02-05 15:03:40.000000000 
+0100
+++ new/pyglet-1.3.2/pyglet/libs/win32/types.py 2018-04-13 16:54:33.000000000 
+0200
@@ -32,12 +32,13 @@
 # POSSIBILITY OF SUCH DAMAGE.
 # ----------------------------------------------------------------------------
 
-'''
-'''
+"""
+"""
 
 __docformat__ = 'restructuredtext'
 __version__ = '$Id: $'
 
+import sys
 import ctypes
 from ctypes import *
 from ctypes.wintypes import *
@@ -56,6 +57,11 @@
 del _int_types
 
 
+# PUINT is defined only from >= python 3.2
+if sys.version_info < (3, 2)[:2]:
+    PUINT = POINTER(UINT)
+
+
 class c_void(Structure):
     # c_void_p is a buggy return type, converting to int, so
     # POINTER(None) == c_void_p is actually written as
@@ -78,6 +84,7 @@
 
     return p
 
+
 c_void_p = POINTER_(c_void)
 INT = c_int
 LPVOID = c_void_p
@@ -104,6 +111,7 @@
 TIMERAPCPROC = WINFUNCTYPE(None, PVOID, DWORD, DWORD)
 MONITORENUMPROC = WINFUNCTYPE(BOOL, HMONITOR, HDC, LPRECT, LPARAM)
 
+
 def MAKEINTRESOURCE(i):
     return cast(ctypes.c_void_p(i & 0xFFFF), c_wchar_p)
 
@@ -122,6 +130,7 @@
         ('lpszClassName', c_wchar_p)
     ]
 
+
 class SECURITY_ATTRIBUTES(Structure):
     _fields_ = [
         ("nLength", DWORD),
@@ -130,6 +139,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class PIXELFORMATDESCRIPTOR(Structure):
     _fields_ = [
         ('nSize', WORD),
@@ -160,6 +170,7 @@
         ('dwDamageMask', DWORD)
     ]
 
+
 class RGBQUAD(Structure):
     _fields_ = [
         ('rgbBlue', BYTE),
@@ -169,6 +180,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class CIEXYZ(Structure):
     _fields_ = [
         ('ciexyzX', DWORD),
@@ -177,6 +189,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class CIEXYZTRIPLE(Structure):
     _fields_ = [
         ('ciexyzRed', CIEXYZ),
@@ -185,6 +198,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class BITMAPINFOHEADER(Structure):
     _fields_ = [
         ('biSize', DWORD),
@@ -200,6 +214,7 @@
         ('biClrImportant', DWORD),
     ]
 
+
 class BITMAPV5HEADER(Structure):
     _fields_ = [
         ('bV5Size', DWORD),
@@ -228,6 +243,7 @@
         ('bV5Reserved', DWORD),
     ]
 
+
 class BITMAPINFO(Structure):
     _fields_ = [
         ('bmiHeader', BITMAPINFOHEADER),
@@ -235,6 +251,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class LOGFONT(Structure):
     _fields_ = [
         ('lfHeight', LONG),
@@ -253,6 +270,7 @@
         ('lfFaceName', (c_char * LF_FACESIZE))  # Use ASCII
     ]
 
+
 class TRACKMOUSEEVENT(Structure):
     _fields_ = [
         ('cbSize', DWORD),
@@ -262,6 +280,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class MINMAXINFO(Structure):
     _fields_ = [
         ('ptReserved', POINT),
@@ -272,6 +291,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class ABC(Structure):
     _fields_ = [
         ('abcA', c_int),
@@ -280,6 +300,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class TEXTMETRIC(Structure):
     _fields_ = [
         ('tmHeight', c_long),
@@ -305,6 +326,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class MONITORINFOEX(Structure):
     _fields_ = [
         ('cbSize', DWORD),
@@ -315,6 +337,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class DEVMODE(Structure):
     _fields_ = [
         ('dmDeviceName', BCHAR * CCHDEVICENAME),
@@ -354,6 +377,7 @@
         ('dmPanningHeight', DWORD),
     ]
 
+
 class ICONINFO(Structure):
     _fields_ = [
         ('fIcon', BOOL),
@@ -364,6 +388,7 @@
     ]
     __slots__ = [f[0] for f in _fields_]
 
+
 class RAWINPUTDEVICE(Structure):
     _fields_ = [
         ('usUsagePage', USHORT),
@@ -372,9 +397,11 @@
         ('hwndTarget', HWND)
     ]
 
+
 PCRAWINPUTDEVICE = POINTER(RAWINPUTDEVICE)
 HRAWINPUT = HANDLE
 
+
 class RAWINPUTHEADER(Structure):
     _fields_ = [
         ('dwType', DWORD),
@@ -383,12 +410,14 @@
         ('wParam', WPARAM),
     ]
 
+
 class _Buttons(Structure):
     _fields_ = [
         ('usButtonFlags', USHORT),
         ('usButtonData', USHORT),
     ]
 
+
 class _U(Union):
     _anonymous_ = ('_buttons',)
     _fields_ = [
@@ -396,6 +425,7 @@
         ('_buttons', _Buttons),
     ]
 
+
 class RAWMOUSE(Structure):
     _anonymous_ = ('u',)
     _fields_ = [
@@ -407,6 +437,7 @@
         ('ulExtraInformation', ULONG),
     ]
 
+
 class RAWKEYBOARD(Structure):
     _fields_ = [
         ('MakeCode', USHORT),
@@ -417,6 +448,7 @@
         ('ExtraInformation', ULONG),
     ]
 
+
 class RAWHID(Structure):
     _fields_ = [
         ('dwSizeHid', DWORD),
@@ -424,6 +456,7 @@
         ('bRawData', POINTER(BYTE)),
     ]
 
+
 class _RAWINPUTDEVICEUNION(Union):
     _fields_ = [
         ('mouse', RAWMOUSE),
@@ -431,6 +464,7 @@
         ('hid', RAWHID),
     ]
 
+
 class RAWINPUT(Structure):
     _fields_ = [
         ('header', RAWINPUTHEADER),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/text/layout.py 
new/pyglet-1.3.2/pyglet/text/layout.py
--- old/pyglet-1.3.1/pyglet/text/layout.py      2018-02-05 15:03:53.000000000 
+0100
+++ new/pyglet-1.3.2/pyglet/text/layout.py      2018-04-13 16:54:45.000000000 
+0200
@@ -1263,12 +1263,18 @@
                             if new_paragraph:
                                 line.paragraph_end = True
                             yield line
-                            line = _Line(next_start)
-                            line.align = align_iterator[next_start]
-                            line.margin_left = self._parse_distance(
-                                margin_left_iterator[next_start])
-                            line.margin_right = self._parse_distance(
-                                margin_right_iterator[next_start])
+                            try:
+                                line = _Line(next_start)
+                                line.align = align_iterator[next_start]
+                                line.margin_left = self._parse_distance(
+                                    margin_left_iterator[next_start])
+                                line.margin_right = self._parse_distance(
+                                    margin_right_iterator[next_start])
+                            except IndexError:
+                                # XXX This used to throw StopIteration in some 
cases, causing the
+                                # final part of this method not to be 
executed. Refactoring
+                                # required to fix this
+                                return
                             if new_paragraph:
                                 line.paragraph_begin = True
 
@@ -2400,6 +2406,9 @@
         line = self.lines[line]
         x -= self.top_group.translate_x
 
+        if x < line.x:
+            return line.start
+
         position = line.start
         last_glyph_x = line.x
         for box in line.boxes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/text/runlist.py 
new/pyglet-1.3.2/pyglet/text/runlist.py
--- old/pyglet-1.3.1/pyglet/text/runlist.py     2018-02-05 15:03:40.000000000 
+0100
+++ new/pyglet-1.3.2/pyglet/text/runlist.py     2018-04-13 16:54:33.000000000 
+0200
@@ -223,7 +223,7 @@
         if index == i:
             return self.runs[-1].value
 
-        assert False, 'Index not in range'
+        raise IndexError
 
     def __repr__(self):
         return str(list(self))
@@ -296,18 +296,24 @@
         return next(self._run_list_iter)
 
     def __getitem__(self, index):
-        while index >= self.end and index > self.start:
-            # condition has special case for 0-length run (fixes issue 471)
-            self.start, self.end, self.value = next(self)
-        return self.value
+        try:
+            while index >= self.end and index > self.start:
+                # condition has special case for 0-length run (fixes issue 471)
+                self.start, self.end, self.value = next(self)
+            return self.value
+        except StopIteration:
+            raise IndexError
 
     def ranges(self, start, end):
-        while start >= self.end:
-            self.start, self.end, self.value = next(self)
-        yield start, min(self.end, end), self.value
-        while end > self.end:
-            self.start, self.end, self.value = next(self)
-            yield self.start, min(self.end, end), self.value
+        try:
+            while start >= self.end:
+                self.start, self.end, self.value = next(self)
+            yield start, min(self.end, end), self.value
+            while end > self.end:
+                self.start, self.end, self.value = next(self)
+                yield self.start, min(self.end, end), self.value
+        except StopIteration:
+            return
 
 class OverriddenRunIterator(AbstractRunIterator):
     '''Iterator over a `RunIterator`, with a value temporarily replacing
@@ -394,18 +400,21 @@
         self.range_iterators = range_iterators
 
     def ranges(self, start, end):
-        iterators = [i.ranges(start, end) for i in self.range_iterators]
-        starts, ends, values = zip(*[next(i) for i in iterators])
-        starts = list(starts)
-        ends = list(ends)
-        values = list(values)
-        while start < end:
-            min_end = min(ends)
-            yield start, min_end, values
-            start = min_end
-            for i, iterator in enumerate(iterators):
-                if ends[i] == min_end:
-                    starts[i], ends[i], values[i] = next(iterator)
+        try:
+            iterators = [i.ranges(start, end) for i in self.range_iterators]
+            starts, ends, values = zip(*[next(i) for i in iterators])
+            starts = list(starts)
+            ends = list(ends)
+            values = list(values)
+            while start < end:
+                min_end = min(ends)
+                yield start, min_end, values
+                start = min_end
+                for i, iterator in enumerate(iterators):
+                    if ends[i] == min_end:
+                        starts[i], ends[i], values[i] = next(iterator)
+        except StopIteration:
+            return
 
     def __getitem__(self, index):
         return [i[index] for i in self.range_iterators]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet/window/win32/__init__.py 
new/pyglet-1.3.2/pyglet/window/win32/__init__.py
--- old/pyglet-1.3.1/pyglet/window/win32/__init__.py    2018-02-05 
15:03:40.000000000 +0100
+++ new/pyglet-1.3.2/pyglet/window/win32/__init__.py    2018-04-13 
16:54:45.000000000 +0200
@@ -437,7 +437,7 @@
             raw_mouse.dwFlags = RIDEV_NOLEGACY
             raw_mouse.hwndTarget = self._view_hwnd
         else:
-            raw_mouse.dwFlags |= RIDEV_REMOVE
+            raw_mouse.dwFlags = RIDEV_REMOVE
             raw_mouse.hwndTarget = None
 
         if not _user32.RegisterRawInputDevices(
@@ -447,11 +447,6 @@
 
         self._exclusive_mouse_buttons = 0
         if exclusive and self._has_focus:
-            # Move mouse to the center of the window.
-            self._reset_exclusive_mouse_screen()
-            x, y = self._exclusive_mouse_screen
-            self.set_mouse_position(x, y, absolute=True)
-
             # Clip to client area, to prevent large mouse movements taking
             # it outside the client area.
             rect = RECT()
@@ -459,19 +454,16 @@
             _user32.MapWindowPoints(self._view_hwnd, HWND_DESKTOP,
                                     byref(rect), 2)
             _user32.ClipCursor(byref(rect))
+            # Release mouse capture in case is was acquired during mouse click
+            _user32.ReleaseCapture()
         else:
             # Release clip
             _user32.ClipCursor(None)
-            # Move mouse back to the middle of the client area.
-            if self._exclusive_mouse_screen:
-                x, y = self._exclusive_mouse_screen
-                self.set_mouse_position(x, y, absolute=True)
 
         self._exclusive_mouse = exclusive
         self._exclusive_mouse_focus = self._has_focus
         self.set_mouse_platform_visible(not exclusive)
 
-
     def set_mouse_position(self, x, y, absolute=False):
         if not absolute:
             rect = RECT()
@@ -1024,11 +1016,6 @@
         return 0
     '''
 
-    @Win32EventHandler(WM_MOUSEACTIVATE)
-    def _event_mouse_activate(self, msg, wParam, lParam):
-        # The user clicked on the Window. Activate it but eat the click event.
-        return MA_ACTIVATEANDEAT
-
     @Win32EventHandler(WM_SETFOCUS)
     def _event_setfocus(self, msg, wParam, lParam):
         self.dispatch_event('on_activate')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet.egg-info/PKG-INFO 
new/pyglet-1.3.2/pyglet.egg-info/PKG-INFO
--- old/pyglet-1.3.1/pyglet.egg-info/PKG-INFO   2018-02-05 15:04:30.000000000 
+0100
+++ new/pyglet-1.3.2/pyglet.egg-info/PKG-INFO   2018-04-13 16:55:07.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pyglet
-Version: 1.3.1
+Version: 1.3.2
 Summary: Cross-platform windowing and multimedia library
 Home-page: http://pyglet.readthedocs.org/en/latest/
 Author: Alex Holkner
@@ -26,5 +26,6 @@
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
 Classifier: Topic :: Games/Entertainment
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/pyglet.egg-info/SOURCES.txt 
new/pyglet-1.3.2/pyglet.egg-info/SOURCES.txt
--- old/pyglet-1.3.1/pyglet.egg-info/SOURCES.txt        2018-02-05 
15:04:30.000000000 +0100
+++ new/pyglet-1.3.2/pyglet.egg-info/SOURCES.txt        2018-04-13 
16:55:08.000000000 +0200
@@ -914,4 +914,6 @@
 tests/unit/media/test_riff.py
 tests/unit/media/test_silent_player.py
 tests/unit/media/test_sources.py
+tests/unit/text/__init__.py
+tests/unit/text/test_layout.py
 tools/inspect_font.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/setup.py new/pyglet-1.3.2/setup.py
--- old/pyglet-1.3.1/setup.py   2018-02-05 15:03:53.000000000 +0100
+++ new/pyglet-1.3.2/setup.py   2018-04-13 16:54:45.000000000 +0200
@@ -5,7 +5,7 @@
 from setuptools import setup, find_packages
 
 # Bump pyglet/__init__.py version as well.
-VERSION = '1.3.1'
+VERSION = '1.3.2'
 
 long_description = '''pyglet provides an object-oriented programming
 interface for developing games and other visually-rich applications
@@ -59,6 +59,7 @@
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
         'Topic :: Games/Entertainment',
         'Topic :: Software Development :: Libraries :: Python Modules',
     ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyglet-1.3.1/tests/unit/text/test_layout.py 
new/pyglet-1.3.2/tests/unit/text/test_layout.py
--- old/pyglet-1.3.1/tests/unit/text/test_layout.py     1970-01-01 
01:00:00.000000000 +0100
+++ new/pyglet-1.3.2/tests/unit/text/test_layout.py     2018-04-13 
16:54:33.000000000 +0200
@@ -0,0 +1,19 @@
+import pyglet
+
+def test_incrementallayout_get_position_on_line_before_start_of_text():
+    single_line_text = "This is a single line of text."
+    document = pyglet.text.document.UnformattedDocument(single_line_text)
+    font = document.get_font()
+    layout = pyglet.text.layout.IncrementalTextLayout(document,
+                                                      height = font.ascent - 
font.descent,
+                                                      width = 200,
+                                                      multiline=False)
+    layout.x = 100
+    layout.y = 100
+
+    assert layout.get_position_on_line(0, 100) == 0
+    assert layout.get_position_on_line(0, 90) == 0
+    assert layout.get_position_on_line(0, 80) == 0
+    assert layout.get_position_on_line(0, 70) == 0
+    assert layout.get_position_on_line(0, 60) == 0
+    assert layout.get_position_on_line(0, 50) == 0

++++++ pypng-license.patch ++++++
Index: pyglet-1.3.2/LICENSE.pypng
===================================================================
--- /dev/null
+++ pyglet-1.3.2/LICENSE.pypng
@@ -0,0 +1,27 @@
+Copyright (C) 2006 Johann C. Rocholl <[email protected]>
+Portions Copyright (C) 2009 David Jones <[email protected]>
+And probably portions Copyright (C) 2006 Nicko van Someren <[email protected]>
+
+Original concept by Johann C. Rocholl.
+
+LICENCE (MIT)
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
Index: pyglet-1.3.2/pyglet/extlibs/png.py
===================================================================
--- pyglet-1.3.2.orig/pyglet/extlibs/png.py
+++ pyglet-1.3.2/pyglet/extlibs/png.py
@@ -41,34 +41,6 @@
 # * Added Pyglet license
 
 # png.py - PNG encoder/decoder in pure Python
-#
-# Copyright (C) 2006 Johann C. Rocholl <[email protected]>
-# Portions Copyright (C) 2009 David Jones <[email protected]>
-# And probably portions Copyright (C) 2006 Nicko van Someren <[email protected]>
-#
-# Original concept by Johann C. Rocholl.
-#
-# LICENCE (MIT)
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation files
-# (the "Software"), to deal in the Software without restriction,
-# including without limitation the rights to use, copy, modify, merge,
-# publish, distribute, sublicense, and/or sell copies of the Software,
-# and to permit persons to whom the Software is furnished to do so,
-# subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 """
 Pure Python PNG Reader/Writer

Reply via email to