code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/python
# $Id:$
import unittest
from pyglet.image import atlas
__noninteractive = True
class Rect(object):
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def __repr__(self):
return 'Rect(%d, %d to %d, %d)' % (
... | Python |
#!/usr/bin/env python
'''Test rearrangement of color components using the OpenGL color matrix.
The test will be skipped if the GL_ARB_imaging extension is not present.
You should see the RGB test image correctly rendered. Press ESC to
end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id... | Python |
#!/usr/bin/env python
'''Test LA load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the la.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'):
... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_8bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_loa... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_1bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_loa... | Python |
#!/usr/bin/env python
'''Test RGBA save using PIL. You should see rgba.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet.image import *
from pyglet.window import *
__noninteractive = True
class TestTextureGrid(unittest.TestCase):
def set_grid_image(self, itemwidth, itemheight, rows, cols, r... | Python |
#!/usr/bin/env python
'''Test colour buffer save.
A scene consisting of a single coloured triangle will be rendered. The
colour buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
buffer image appears (because retrieving... | Python |
#!/usr/bin/env python
'''Test RGB save using PIL. You should see rgb.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
im... | Python |
#!/usr/bin/env python
'''Test L load using PyPNG. You should see the l.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_L_LOAD(base_load.TestLoad):
... | Python |
#!/usr/bin/env python
'''Test RGB load using PIL. You should see the rgb.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PIL_RGB_LOAD(base_load.TestLoad):
textu... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_4bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_loa... | Python |
#!/usr/bin/env python
'''Test RGBA save using PIL. You should see rgba.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
... | Python |
#!/usr/bin/env python
'''Test RGBA load using PIL. You should see the rgba.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PIL_RGBA_LOAD(base_load.TestLoad):
te... | Python |
#!/usr/bin/env python
'''Test DXT5 compressed RGBA load from a DDS file. You should see the
rgba_dxt5.dds image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_... | Python |
#!/usr/bin/env python
'''Test colour buffer save.
A scene consisting of a single coloured triangle will be rendered. The
colour buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
buffer image appears (because retrieving... | Python |
#!/usr/bin/env python
'''Test DXT1 compressed RGB load from a DDS file. You should see the
rgb_dxt1.dds image.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_RGB_DXT1(base_load.TestLoad):... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_1bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_loa... | Python |
#!/usr/bin/env python
'''Base class for image tests.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from StringIO import StringIO
from os.path import dirname, join
from pyglet.gl import *
from pyglet import image
from pyglet.image import codecs
from pyglet.window import *
from pyglet.... | Python |
#!/usr/bin/env python
'''Test RGBA load using PyPNG. You should see the rgba.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_RGBA_LOAD(base_load.Te... | Python |
#!/usr/bin/env python
'''Test L load using PIL. You should see the la.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PIL_L(base_load.TestLoad):
texture_file = 'l... | Python |
#!/usr/bin/env python
'''Test RGB save using PIL. You should see rgb.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
im... | Python |
#!/usr/bin/env python
'''Test colour buffer copy to texture.
A scene consisting of a single coloured triangle will be rendered. The
colour buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
buffer image appears (because r... | Python |
#!/usr/bin/env python
'''Base class for image tests.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from os.path import dirname, join
from pyglet.gl import *
from pyglet import image
from pyglet.image import codecs
from pyglet.window import *
from pyglet.window.event import *
from te... | Python |
#!/usr/bin/env python
'''Test LA save using PyPNG. You should see la.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
impo... | Python |
#!/usr/bin/env python
'''Test L load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the l.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'):
... | Python |
#!/usr/bin/env python
'''Test LA save using PIL. You should see la.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import... | Python |
#!/usr/bin/env python
'''Test L save using PIL. You should see l.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import b... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet.image import *
from pyglet.window import *
__noninteractive = True
class TestTextureGrid(unittest.TestCase):
def set_grid_image(self, itemwidth, itemheight, rows, cols, r... | Python |
#!/usr/bin/env python
'''Test depth buffer save.
A scene consisting of a single coloured triangle will be rendered. The
depth buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
depth buffer image appears (because retrie... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet.image import *
from pyglet.window import *
__noninteractive = True
class TestTexture3D(unittest.TestCase):
def create_image(self, width, height, color):
data = ('... | Python |
#!/usr/bin/env python
'''Test that the checkerboard pattern looks correct.
One window will open, it should show one instance of the checkerboard
pattern in two levels of grey.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet.... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_16bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... | Python |
#!/usr/bin/env python
'''Test L save using PyPNG. You should see l.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import... | Python |
#!/usr/bin/env python
'''Test RGB save using PyPNG. You should see rgb.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_8bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_loa... | Python |
#!/usr/bin/env python
'''Test RGBA load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the rgba.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'... | Python |
#!/usr/bin/env python
'''Test framework for pyglet. Reads details of components and capabilities
from a requirements document, runs the appropriate unit tests.
How to Run the Tests
--------------------
::
python tests/test.py top app graphics clock resource # these all run automatically
python tests/test.py... | Python |
#!/usr/bin/env python
'''Test that inline elements can have their style changed, even after text
has been deleted before them. [This triggers bug 538 if it has not yet been fixed.]
To run the test, delete the first line, one character at a time,
verifying that the element remains visible and no tracebacks are
printed... | Python |
#!/usr/bin/env python
'''Test that HTML data is decoded into a formatted document.
Press ESC to exit the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: ELEMENT.py 1764 2008-02-16 05:24:46Z Alex.Holkner $'
import unittest
import pyglet
from pyglet.text import caret, document, layout
doctext = '''
... | Python |
#!/usr/bin/env python
'''Test that an empty document doesn't break, even when its
(nonexistent) text is set to bold.
'''
__docformat__ = 'restructuredtext'
__noninteractive = True
import unittest
from pyglet import gl
from pyglet import graphics
from pyglet.text import document
from pyglet.text import layout
from ... | Python |
#!/usr/bin/env python
'''Test that character and paragraph-level style is adhered to correctly in
incremental layout.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel. There are no formatting
commands, however formatting should be preserved as expec... | Python |
#!/usr/bin/python
# $Id:$
from pyglet.text import runlist
import unittest
__noninteractive = True
class TestStyleRuns(unittest.TestCase):
def check_value(self, runs, value):
for i, style in enumerate(value):
self.assertTrue(runs[i] == style, repr(runs.runs))
self.check_optimal(runs)
... | Python |
#!/usr/bin/env python
'''Test that a paragraph is broken or not according the settings in an
incremental layout.
Three windows will be open (one per test) showing:
- A paragraph in a single line, skipping newlines and no wrapping the line.
- A paragraph in multiple lines, but the long lines will no be wrapped.... | Python |
#!/usr/bin/env python
'''Test that an empty document doesn't break.
'''
__docformat__ = 'restructuredtext'
__noninteractive = True
import unittest
from pyglet import gl
from pyglet import graphics
from pyglet.text import document
from pyglet.text import layout
from pyglet import window
class TestWindow(window.Win... | Python |
#!/usr/bin/env python
'''Test that a paragraph is broken or not according the settings in an
incremental layout.
Three windows will be open (one per test) showing:
- A paragraph in a single line, skipping newlines and no wrapping the line.
- A paragraph in multiple lines, but the long lines will no be wrapped.... | Python |
#!/usr/bin/env python
'''Test that HTML data is decoded into a formatted document.
Press ESC to exit the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: ELEMENT.py 1764 2008-02-16 05:24:46Z Alex.Holkner $'
import unittest
import pyglet
from pyglet.text import caret, document, layout
doctext = '''
... | Python |
#!/usr/bin/python
# $Id:$
from pyglet.text import runlist
import unittest
__noninteractive = True
class TestStyleRuns(unittest.TestCase):
def check_value(self, runs, value):
for i, style in enumerate(value):
self.assertTrue(runs[i] == style, repr(runs.runs))
self.check_optimal(runs)
... | Python |
#!/usr/bin/env python
'''Test that inline elements are positioned correctly and are repositioned
within an incremental layout.
Examine and type over the text in the window that appears. There are several
elements drawn with grey boxes. These should maintain their sizes and
relative document positions as the text is... | Python |
#!/usr/bin/env python
'''Test that character and paragraph-level style is adhered to correctly in
incremental layout.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel. There are no formatting
commands, however formatting should be preserved as expec... | Python |
#!/usr/bin/env python
'''Test an unformatted document is editable.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel.
Press ESC to exit the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: STYLE.py 1754 2008-02-10 13:26:52Z Alex.Holk... | Python |
#!/usr/bin/env python
'''Test that an empty document doesn't break.
'''
__docformat__ = 'restructuredtext'
__noninteractive = True
import unittest
from pyglet import gl
from pyglet import graphics
from pyglet.text import document
from pyglet.text import layout
from pyglet import window
class TestWindow(window.Win... | Python |
#!/usr/bin/env python
'''Test that an empty document doesn't break, even when its
(nonexistent) text is set to bold.
'''
__docformat__ = 'restructuredtext'
__noninteractive = True
import unittest
from pyglet import gl
from pyglet import graphics
from pyglet.text import document
from pyglet.text import layout
from ... | Python |
#!/usr/bin/env python
'''Test that inline elements can have their style changed, even after text
has been deleted before them. [This triggers bug 538 if it has not yet been fixed.]
To run the test, delete the first line, one character at a time,
verifying that the element remains visible and no tracebacks are
printed... | Python |
#!/usr/bin/env python
'''Test content_valign = 'bottom' property of IncrementalTextLayout.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel. When the content height
is less than the window height, the content should be aligned to the bottom
of the w... | Python |
#!/usr/bin/env python
'''Test content_valign = 'center' property of IncrementalTextLayout.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel. When the content height
is less than the window height, the content should be aligned to the center
of the w... | Python |
#!/usr/bin/env python
'''Test that the code snippets mentioned in issue 471
(and related issues 241 and 429) don't have exceptions.
(Most of them delete all text in a formatted document
with some styles set; one of them (like the test in EMPTY_BOLD.py)
sets style on a 0-length range of text in an empty document.)
'''... | Python |
#!/usr/bin/env python
'''Test that the code snippets mentioned in issue 471
(and related issues 241 and 429) don't have exceptions.
(Most of them delete all text in a formatted document
with some styles set; one of them (like the test in EMPTY_BOLD.py)
sets style on a 0-length range of text in an empty document.)
'''... | Python |
#!/usr/bin/env python
'''Test an unformatted document is editable.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel.
Press ESC to exit the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: STYLE.py 1754 2008-02-10 13:26:52Z Alex.Holk... | Python |
#!/usr/bin/env python
'''Test that inline elements are positioned correctly and are repositioned
within an incremental layout.
Examine and type over the text in the window that appears. There are several
elements drawn with grey boxes. These should maintain their sizes and
relative document positions as the text is... | Python |
#!/usr/bin/env python
'''Test content_valign = 'center' property of IncrementalTextLayout.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel. When the content height
is less than the window height, the content should be aligned to the center
of the w... | Python |
#!/usr/bin/env python
'''Test content_valign = 'bottom' property of IncrementalTextLayout.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel. When the content height
is less than the window height, the content should be aligned to the bottom
of the w... | Python |
#!/usr/bin/env python
'''Test framework for pyglet. Reads details of components and capabilities
from a requirements document, runs the appropriate unit tests.
Overview
--------
First, some definitions:
Test case:
A single test, implemented by a Python module in the tests/ directory.
Tests can be interacti... | Python |
#!/usr/bin/env python
'''Test that a scheduled function gets called every interval with the correct
time delta.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import time
import unittest
from pyglet import clock
__noninteractive = True
class SCHEDULE_IN... | Python |
#!/usr/bin/env python
'''Test that the clock effectively limits the FPS to 20 Hz when requested.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
import unittest
from pyglet import clock
__noninteractive = True
class FPS_LIMIT(unittest.TestCase):
def test_fps_limit(self):
clock.... | Python |
#!/usr/bin/env python
'''Test that a scheduled function gets called every tick with the correct
time delta.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import time
import unittest
from pyglet import clock
__noninteractive = True
class SCHEDULE(unitte... | Python |
#!/usr/bin/env python
'''Test that the clock tick function returns the elaspsed time between
frames, in seconds.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
import unittest
from pyglet import clock
__noninteractive = True
class TICK(unittest.TestCase):
def test_tick(self):
... | Python |
#!/usr/bin/env python
'''Test that a scheduled function gets called every once with the correct
time delta.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import time
import unittest
from pyglet import clock
__noninteractive = True
class SCHEDULE_ONCE(u... | Python |
#!/usr/bin/env python
'''Test that a scheduled function gets called every interval with the correct
time delta.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import time
import unittest
from pyglet import clock
__noninteractive = True
class SCHEDULE_IN... | Python |
#!/usr/bin/env python
# Contributed by Claudio Canepa
# Integrated by Ben Smith
""" There is the possibility that time.clock be non monotonic in multicore hardware,
due to the underlaying use of win32 QueryPerformanceCounter.
If your update is seeing a negative dt, then time.clock is probably the culprit.
AM... | Python |
#!/usr/bin/env python
'''Test that a scheduled function gets called every tick with the correct
time delta.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import time
import unittest
from pyglet import clock
__noninteractive = True
class SCHEDULE(unitte... | Python |
#!/usr/bin/env python
'''Test that the clock effectively limits the FPS to 20 Hz when requested.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
import unittest
from pyglet import clock
__noninteractive = True
class FPS_LIMIT(unittest.TestCase):
def test_fps_limit(self):
clock.... | Python |
#!/usr/bin/env python
'''Test that the clock returns a reasonable average FPS calculation when
stimulated at 5 Hz.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
import unittest
from pyglet import clock
__noninteractive = True
class FPS(unittest.TestCase):
def test_fps(self):
... | Python |
#!/usr/bin/env python
# Contributed by Claudio Canepa
# Integrated by Ben Smith
""" There is the possibility that time.clock be non monotonic in multicore hardware,
due to the underlaying use of win32 QueryPerformanceCounter.
If your update is seeing a negative dt, then time.clock is probably the culprit.
AM... | Python |
#!/usr/bin/env python
'''Test that the clock returns a reasonable average FPS calculation when
stimulated at 5 Hz.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
import unittest
from pyglet import clock
__noninteractive = True
class FPS(unittest.TestCase):
def test_fps(self):
... | Python |
#!/usr/bin/env python
'''Test that the clock tick function returns the elaspsed time between
frames, in seconds.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
import unittest
from pyglet import clock
__noninteractive = True
class TICK(unittest.TestCase):
def test_tick(self):
... | Python |
#!/usr/bin/env python
'''Test that a scheduled function gets called every once with the correct
time delta.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import time
import unittest
from pyglet import clock
__noninteractive = True
class SCHEDULE_ONCE(u... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions /... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions / 4:
self.fail('Incorrect number of vertices in feedb... | Python |
#!/usr/bin/python
# $Id:$
import random
import unittest
from pyglet.graphics import allocation
__noninteractive = True
class Region(object):
def __init__(self, start, size):
self.start = start
self.size = size
def __repr__(self):
return 'Region(%r, %r)' % (self.start, self.size)
cl... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions /... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
from operator import add
import random
from pyglet.gl import *
n_vertices = 42
v3f_data = [v/float(n_vertices*3 + 10) for v in range(n_vertices * 3)]
v2f_data = reduce(add, zip(v3f_data[::3], v3f_data[1::3]))
c4f_data = [v/floa... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions / 4:
self.fail('Incorrect number of vertices in feedb... | Python |
#!/usr/bin/env python
'''Draws a full-window quad with two texture units enabled and multi
texcoords. Texture unit 0 is a checker pattern of yellow and cyan with
env mode replace. Texture unit 1 is a checker pattern of cyan and yellow,
with env mode modulate. The result should be flat green (with some variation
in ... | Python |
#!/usr/bin/python
# $Id:$
import random
import unittest
from pyglet.graphics import allocation
__noninteractive = True
class Region(object):
def __init__(self, start, size):
self.start = start
self.size = size
def __repr__(self):
return 'Region(%r, %r)' % (self.start, self.size)
cl... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions / 4:
self.fail('Incorrect number of vertices in feedb... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions /... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions /... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
from operator import add
import random
from pyglet.gl import *
n_vertices = 42
v3f_data = [v/float(n_vertices*3 + 10) for v in range(n_vertices * 3)]
v2f_data = reduce(add, zip(v3f_data[::3], v3f_data[1::3]))
c4f_data = [v/floa... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions / 4:
self.fail('Incorrect number of vertices in feedb... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions / 4:
self.fail('Incorrect number of vertices in feedb... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import pyglet
from graphics_common import *
__noninteractive = True
class TEST_CASE(unittest.TestCase):
def check(self, expected, result, dimensions):
if len(expected) != len(result) * dimensions / 4:
self.fail('Incorrect number of vertices in feedb... | Python |
#!/usr/bin/env python
'''Draws a full-window quad with two texture units enabled and multi
texcoords. Texture unit 0 is a checker pattern of yellow and cyan with
env mode replace. Texture unit 1 is a checker pattern of cyan and yellow,
with env mode modulate. The result should be flat green (with some variation
in ... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import shutil
import sys
# Bump pyglet/__init__.py version as well.
VERSION = '1.2alpha1'
long_description = '''pyglet provides an object-oriented programming
interface for developing games and other visually-rich appli... | Python |
#!/usr/bin/python
# $Id:$
'''Display font information.
Usage::
inspect_font.py <filename> [<filename> ...]
'''
import sys
from pyglet.font import ttf
def inspect_font(filename):
try:
info = ttf.TruetypeInfo(filename)
print '%s:' % filename,
print info.get_name('family'),
pr... | Python |
#!/usr/bin/python
# $Id:$
'''Display font information.
Usage::
inspect_font.py <filename> [<filename> ...]
'''
import sys
from pyglet.font import ttf
def inspect_font(filename):
try:
info = ttf.TruetypeInfo(filename)
print '%s:' % filename,
print info.get_name('family'),
pr... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.