7 new revisions:
Revision: cf08d3d4b601
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:04:33 2014 UTC
Log: Python 3 compatibility...
http://code.google.com/p/pyglet/source/detail?r=cf08d3d4b601
Revision: fd8b20db3bc8
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:07:25 2014 UTC
Log: Python 3 compatibility...
http://code.google.com/p/pyglet/source/detail?r=fd8b20db3bc8
Revision: a92ce8efd03f
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:07:45 2014 UTC
Log: Added Claudio Canepa to the contributors list
http://code.google.com/p/pyglet/source/detail?r=a92ce8efd03f
Revision: 0cb71df3261a
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:17:04 2014 UTC
Log: Python 3 compatibility...
http://code.google.com/p/pyglet/source/detail?r=0cb71df3261a
Revision: 8b63c61e838b
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:47:56 2014 UTC
Log: Python 3 compatibility...
http://code.google.com/p/pyglet/source/detail?r=8b63c61e838b
Revision: 9feab2ae9cf8
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:48:51 2014 UTC
Log: Python 3 compatibility...
http://code.google.com/p/pyglet/source/detail?r=9feab2ae9cf8
Revision: af64b8ab77ff
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:54:03 2014 UTC
Log: refactored common texture test code
http://code.google.com/p/pyglet/source/detail?r=af64b8ab77ff
==============================================================================
Revision: cf08d3d4b601
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:04:33 2014 UTC
Log: Python 3 compatibility
Thanks to RisimiRox for the patch.
Fixes issue #718.
http://code.google.com/p/pyglet/source/detail?r=cf08d3d4b601
Added:
/tests/image/8bpp.gif
/tests/image/GIF_LOAD.py
Modified:
/pyglet/image/codecs/gif.py
/tests/plan.txt
=======================================
--- /dev/null
+++ /tests/image/8bpp.gif Tue Apr 1 16:04:33 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /tests/image/GIF_LOAD.py Tue Apr 1 16:04:33 2014 UTC
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+'''Test load using the Python gdkpixbuf2 GIF loader. You should see the
8bpp.gif
+image on a checkboard background.
+'''
+
+__docformat__ = 'restructuredtext'
+__version__ = '$Id$'
+
+import unittest
+import base_load
+
+from pyglet.image.codecs.gdkpixbuf2 import GdkPixbuf2ImageDecoder
+
+class TEST_GIF_LOAD(base_load.TestLoad):
+ texture_file = '8bpp.gif'
+ decoder = GdkPixbuf2ImageDecoder()
+
+if __name__ == '__main__':
+ unittest.main()
=======================================
--- /pyglet/image/codecs/gif.py Mon Feb 2 04:35:13 2009 UTC
+++ /pyglet/image/codecs/gif.py Tue Apr 1 16:04:33 2014 UTC
@@ -81,7 +81,7 @@
# 17. Header
signature = file.read(3)
version = file.read(3)
- if signature != 'GIF':
+ if signature != b'GIF':
raise ImageDecodeException('Not a GIF stream')
stream = GIFStream()
=======================================
--- /tests/plan.txt Wed Dec 11 19:18:31 2013 UTC
+++ /tests/plan.txt Tue Apr 1 16:04:33 2014 UTC
@@ -182,6 +182,9 @@
image-atlas
image.ATLAS GENERIC
+ image-gdkpixbuf2
+ image.GIF_LOAD X11
+
font
font-render
font.DEFAULT X11 WIN OSX
==============================================================================
Revision: fd8b20db3bc8
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:07:25 2014 UTC
Log: Python 3 compatibility
Thanks to Claudio Canepa for the patch.
Fixes issue #719.
http://code.google.com/p/pyglet/source/detail?r=fd8b20db3bc8
Modified:
/pyglet/image/codecs/bmp.py
=======================================
--- /pyglet/image/codecs/bmp.py Fri Apr 18 14:30:48 2008 UTC
+++ /pyglet/image/codecs/bmp.py Tue Apr 1 16:07:25 2014 UTC
@@ -157,7 +157,7 @@
bytes = file.read()
buffer = ctypes.c_buffer(bytes)
- if bytes[:2] != 'BM':
+ if bytes[:2] != b'BM':
raise ImageDecodeException(
'Not a Windows bitmap file: %r' % (filename or file))
==============================================================================
Revision: a92ce8efd03f
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:07:45 2014 UTC
Log: Added Claudio Canepa to the contributors list
http://code.google.com/p/pyglet/source/detail?r=a92ce8efd03f
Modified:
/NOTICE
=======================================
--- /NOTICE Sat Dec 7 19:31:56 2013 UTC
+++ /NOTICE Tue Apr 1 16:07:45 2014 UTC
@@ -32,6 +32,7 @@
anatoly techtonik
Juan J. Martinez
Txema Vicente
+Claudio Canepa
pyglet/libs/win32/constants.py is derived from Python for Windows
Extensions. Copyright 1994-2001 Mark Hammond.
==============================================================================
Revision: 0cb71df3261a
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:17:04 2014 UTC
Log: Python 3 compatibility
Thanks to Claudio Canepa for the patch.
Fixes issue #720.
http://code.google.com/p/pyglet/source/detail?r=0cb71df3261a
Modified:
/tests/image/BUFFER_COPY.py
/tests/image/BUFFER_SAVE.py
/tests/image/DEPTH_SAVE.py
/tests/image/base_save.py
=======================================
--- /tests/image/BUFFER_COPY.py Sun Dec 9 00:03:55 2007 UTC
+++ /tests/image/BUFFER_COPY.py Tue Apr 1 16:17:04 2014 UTC
@@ -14,7 +14,6 @@
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
-from StringIO import StringIO
import unittest
import base_save
@@ -37,16 +36,16 @@
glColor4f(1, 1, 1, 1)
def load_texture(self):
- print 'Drawing scene...'
+ print('Drawing scene...')
self.window.set_visible()
self.window.dispatch_events()
self.draw()
- print 'Copying colour image...'
+ print('Copying colour image...')
self.saved_texture = \
image.get_buffer_manager().get_color_buffer().texture
- print 'Done.'
+ print('Done.')
self.window.set_visible(False)
if __name__ == '__main__':
=======================================
--- /tests/image/BUFFER_SAVE.py Fri Oct 26 08:09:40 2007 UTC
+++ /tests/image/BUFFER_SAVE.py Tue Apr 1 16:17:04 2014 UTC
@@ -14,12 +14,12 @@
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
-from StringIO import StringIO
import unittest
import base_save
from
pyglet.gl import *
from pyglet import image
+from pyglet.compat import BytesIO
class TEST_BUFFER_SAVE(base_save.TestSave):
alpha = False
@@ -37,21 +37,21 @@
glColor4f(1, 1, 1, 1)
def load_texture(self):
- print 'Drawing scene...'
+ print('Drawing scene...')
self.window.set_visible()
self.window.dispatch_events()
self.draw()
- print 'Saving colour image...'
+ print('Saving colour image...')
img = image.get_buffer_manager().get_color_buffer()
- file = StringIO()
+ file = BytesIO()
img.save('buffer.png', file)
- print 'Loading colour image as texture...'
+ print('Loading colour image as texture...')
file.seek(0)
self.saved_texture = image.load('buffer.png', file)
- print 'Done.'
+ print('Done.')
self.window.set_visible(False)
if __name__ == '__main__':
=======================================
--- /tests/image/DEPTH_SAVE.py Fri Oct 26 08:09:40 2007 UTC
+++ /tests/image/DEPTH_SAVE.py Tue Apr 1 16:17:04 2014 UTC
@@ -14,12 +14,12 @@
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
-from StringIO import StringIO
import unittest
import base_save
from
pyglet.gl import *
from pyglet import image
+from pyglet.compat import BytesIO
class TEST_DEPTH_SAVE(base_save.TestSave):
alpha = False
@@ -41,21 +41,21 @@
glColor4f(1, 1, 1, 1)
def load_texture(self):
- print 'Drawing scene...'
+ print('Drawing scene...')
self.window.set_visible()
self.window.dispatch_events()
self.draw()
- print 'Saving depth image...'
+ print('Saving depth image...')
img = image.get_buffer_manager().get_depth_buffer()
- file = StringIO()
+ file = BytesIO()
img.save('buffer.png', file)
- print 'Loading depth image as texture...'
+ print('Loading depth image as texture...')
file.seek(0)
self.saved_texture = image.load('buffer.png', file)
- print 'Done.'
+ print('Done.')
self.window.set_visible(False)
if __name__ == '__main__':
=======================================
--- /tests/image/base_save.py Thu Oct 4 14:04:36 2007 UTC
+++ /tests/image/base_save.py Tue Apr 1 16:17:04 2014 UTC
@@ -7,7 +7,6 @@
__version__ = '$Id: $'
import unittest
-from StringIO import StringIO
from os.path import dirname, join
from
pyglet.gl import *
@@ -15,6 +14,7 @@
from pyglet.image import codecs
from pyglet.window import *
from pyglet.window.event import *
+from pyglet.compat import BytesIO
from tests.regression import ImageRegressionTestCase
@@ -76,7 +76,7 @@
self.texture_file = join(dirname(__file__), self.texture_file)
self.original_texture = image.load(self.texture_file).texture
- file = StringIO()
+ file = BytesIO()
self.original_texture.save(self.texture_file, file,
encoder=self.encoder)
file.seek(0)
==============================================================================
Revision: 8b63c61e838b
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:47:56 2014 UTC
Log: Python 3 compatibility
Thanks to Claudio Canepa for the patch!
http://code.google.com/p/pyglet/source/detail?r=8b63c61e838b
Modified:
/tests/image/TEXTURE_GRID.py
=======================================
--- /tests/image/TEXTURE_GRID.py Sun Feb 17 12:45:54 2008 UTC
+++ /tests/image/TEXTURE_GRID.py Tue Apr 1 16:47:56 2014 UTC
@@ -14,23 +14,29 @@
__noninteractive = True
+def colorbyte(color):
+ if sys.version.startswith('2'):
+ return '%c' % color
+ else:
+ return bytes((color,))
+
class TestTextureGrid(unittest.TestCase):
def set_grid_image(self, itemwidth, itemheight, rows, cols, rowpad,
colpad):
- data = ''
+ data = b''
color = 1
width = itemwidth * cols + colpad * (cols - 1)
height = itemheight * rows + rowpad * (rows - 1)
for row in range(rows):
- rowdata = ''
+ rowdata = b''
for col in range(cols):
- rowdata += ('%c' % color) * itemwidth
+ rowdata += colorbyte(color) * itemwidth
if col < cols - 1:
- rowdata += '\0' * colpad
+ rowdata += b'\0' * colpad
color += 1
data += rowdata * itemheight
if row < rows - 1:
- data += (width * '\0') * rowpad
+ data += (width * b'\0') * rowpad
assert len(data) == width * height
self.image = ImageData(width, height, 'L', data)
self.grid = ImageGrid(self.image, rows, cols,
@@ -40,7 +46,7 @@
self.assertTrue(cellimage.width == self.grid.item_width)
self.assertTrue(cellimage.height == self.grid.item_height)
- color = '%c' % (cellindex + 1)
+ color = colorbyte(cellindex + 1)
cellimage = cellimage.image_data
data = cellimage.get_data('L', cellimage.width)
self.assertTrue(data == color * len(data))
==============================================================================
Revision: 9feab2ae9cf8
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:48:51 2014 UTC
Log: Python 3 compatibility
Thanks to Claudio Canepa for the patch.
Fixes issue #721.
http://code.google.com/p/pyglet/source/detail?r=9feab2ae9cf8
Modified:
/tests/image/TEXTURE_3D.py
=======================================
--- /tests/image/TEXTURE_3D.py Sun Feb 17 12:45:54 2008 UTC
+++ /tests/image/TEXTURE_3D.py Tue Apr 1 16:48:51 2014 UTC
@@ -14,35 +14,40 @@
__noninteractive = True
+def colorbyte(color):
+ if sys.version.startswith('2'):
+ return '%c' % color
+ else:
+ return bytes((color,))
+
class TestTexture3D(unittest.TestCase):
def create_image(self, width, height, color):
- data = ('%c' % color) * (width * height)
+ data = colorbyte(color) * (width * height)
return ImageData(width, height, 'L', data)
def check_image(self, image, width, height, color):
self.assertTrue(image.width == width)
self.assertTrue(image.height == height)
- color = '%c' % (color)
image = image.image_data
data = image.get_data('L', image.width)
- self.assertTrue(data == color * len(data))
+ self.assertTrue(data == colorbyte(color) * len(data))
def set_grid_image(self, itemwidth, itemheight, rows, cols, rowpad,
colpad):
- data = ''
+ data = b''
color = 1
width = itemwidth * cols + colpad * (cols - 1)
height = itemheight * rows + rowpad * (rows - 1)
for row in range(rows):
- rowdata = ''
+ rowdata = b''
for col in range(cols):
- rowdata += ('%c' % color) * itemwidth
+ rowdata += colorbyte(color) * itemwidth
if col < cols - 1:
- rowdata += '\0' * colpad
+ rowdata += b'\0' * colpad
color += 1
data += rowdata * itemheight
if row < rows - 1:
- data += (width * '\0') * rowpad
+ data += (width * b'\0') * rowpad
assert len(data) == width * height
self.image = ImageData(width, height, 'L', data)
grid = ImageGrid(self.image, rows, cols,
@@ -53,10 +58,9 @@
self.assertTrue(cellimage.width == self.grid.item_width)
self.assertTrue(cellimage.height == self.grid.item_height)
- color = '%c' % (cellindex + 1)
cellimage = cellimage.image_data
data = cellimage.get_data('L', cellimage.width)
- self.assertTrue(data == color * len(data))
+ self.assertTrue(data == colorbyte(cellindex + 1) * len(data))
def setUp(self):
self.w = Window(visible=False)
==============================================================================
Revision: af64b8ab77ff
Branch: default
Author: Juan J. Martínez <
j...@usebox.net>
Date: Tue Apr 1 16:54:03 2014 UTC
Log: refactored common texture test code
http://code.google.com/p/pyglet/source/detail?r=af64b8ab77ff
Added:
/tests/image/texture_base.py
Modified:
/tests/image/TEXTURE_3D.py
/tests/image/TEXTURE_GRID.py
=======================================
--- /dev/null
+++ /tests/image/texture_base.py Tue Apr 1 16:54:03 2014 UTC
@@ -0,0 +1,9 @@
+import sys
+
+
+def colorbyte(color):
+ if sys.version.startswith('2'):
+ return '%c' % color
+ else:
+ return bytes((color,))
+
=======================================
--- /tests/image/TEXTURE_3D.py Tue Apr 1 16:48:51 2014 UTC
+++ /tests/image/TEXTURE_3D.py Tue Apr 1 16:54:03 2014 UTC
@@ -12,13 +12,9 @@
from pyglet.image import *
from pyglet.window import *
-__noninteractive = True
+from texture_base import colorbyte
-def colorbyte(color):
- if sys.version.startswith('2'):
- return '%c' % color
- else:
- return bytes((color,))
+__noninteractive = True
class TestTexture3D(unittest.TestCase):
def create_image(self, width, height, color):
=======================================
--- /tests/image/TEXTURE_GRID.py Tue Apr 1 16:47:56 2014 UTC
+++ /tests/image/TEXTURE_GRID.py Tue Apr 1 16:54:03 2014 UTC
@@ -12,13 +12,9 @@
from pyglet.image import *
from pyglet.window import *
-__noninteractive = True
+from texture_base import colorbyte
-def colorbyte(color):
- if sys.version.startswith('2'):
- return '%c' % color
- else:
- return bytes((color,))
+__noninteractive = True
class TestTextureGrid(unittest.TestCase):
def set_grid_image(self, itemwidth, itemheight, rows, cols, rowpad,
colpad):