code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/python
# $Id:$
from pyglet.gl import *
def fillrect(x, y, width, height):
glBegin(GL_QUADS)
glVertex2f(x, y)
glVertex2f(x + width, y)
glVertex2f(x + width, y + height)
glVertex2f(x, y + height)
glEnd()
def rect(x, y, width, height):
glBegin(GL_LINE_LOOP)
glVertex2f(x, y)
... | [
[
1,
0,
0.2,
0.05,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
2,
0,
0.45,
0.35,
0,
0.66,
0.5,
160,
0,
4,
0,
0,
0,
0,
6
],
[
8,
1,
0.35,
0.05,
1,
0.43,
0,
2... | [
"from pyglet.gl import *",
"def fillrect(x, y, width, height):\n glBegin(GL_QUADS)\n glVertex2f(x, y)\n glVertex2f(x + width, y)\n glVertex2f(x + width, y + height)\n glVertex2f(x, y + height)\n glEnd()",
" glBegin(GL_QUADS)",
" glVertex2f(x, y)",
" glVertex2f(x + width, y)",
" ... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $'
import unittest
from pyglet.gl import *
from pyglet.ext import projection
from pyglet import window
import base_projection
class VIEWPORT_CLIP(unittest.TestCase):
def tes... | [
[
8,
0,
0.0463,
0.037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0926,
0.0185,
0,
0.66,
0.1111,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1111,
0.0185,
0,
0.66,... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $'",
"import unittest",
"from pyglet.gl import *",
"from pyglet.ext import projection",
"from pyglet import window",
"import base_projection",
"class VIEWPORT_CLIP(unittest.Tes... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $'
import unittest
from pyglet.gl import *
from pyglet.ext import projection
from pyglet import window
import base_projection
class VIEWPORT_ORTHO(unittest.TestCase):
def te... | [
[
8,
0,
0.0481,
0.0385,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0962,
0.0192,
0,
0.66,
0.1111,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1154,
0.0192,
0,
0.66... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $'",
"import unittest",
"from pyglet.gl import *",
"from pyglet.ext import projection",
"from pyglet import window",
"import base_projection",
"class VIEWPORT_ORTHO(unittest.Te... |
#!/usr/bin/env python
'''
Model code for managing sprites
===============================
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from scene2d.drawable import *
class SpriteLayer(object):
'''Represents a group of sprites at the same z depth.
'''
def __init__... | [
[
8,
0,
0.0165,
0.0165,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0297,
0.0033,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.033,
0.0033,
0,
0.66,
... | [
"'''\nModel code for managing sprites\n===============================\n\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"from pyglet.gl import *",
"from scene2d.drawable import *",
"class SpriteLayer(object):\n '''Represents a group of sprites at the same z depth.\n '''\n de... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from ctypes import *
from pyglet.gl import *
from scene2d.sprite import Sprite
from pyglet.font import GlyphString
# TODO: inherit from Sprite
class TextSprite(object):
_layout_width = None # Width to layout text to
_tex... | [
[
8,
0,
0.0243,
0.0139,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0417,
0.0069,
0,
0.66,
0.1429,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0486,
0.0069,
0,
0.66... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"from ctypes import *",
"from pyglet.gl import *",
"from scene2d.sprite import Sprite",
"from pyglet.font import GlyphString",
"class TextSprite(object):\n _layout_width = None # Width to layout text to\n _text_width = 0 ... |
#!/usr/bin/env python
'''
Simple images etc. to aid debugging
===================================
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import math
from scene2d import *
from pyglet import image
from scene2d.drawable import *
from pyglet.gl import *
def brensenham_line(x, y, x2, y2):
'''... | [
[
8,
0,
0.045,
0.045,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0811,
0.009,
0,
0.66,
0.0833,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0901,
0.009,
0,
0.66,
... | [
"'''\nSimple images etc. to aid debugging\n===================================\n\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import math",
"from scene2d import *",
"from pyglet import image",
"from scene2d.drawable import *",
"from pyglet.gl import *",
"def brensenham_line(... |
from pyglet.gl import *
class DrawEnv(object):
'''Sets up drawing environment.
My have either or both of a "before" and "after" method.
'''
pass
class DrawBlended(DrawEnv):
'''Sets up texture env for an alpha-blended draw.
'''
def before(self):
glPushAttrib(GL_ENABLE_BIT | GL_CO... | [
[
1,
0,
0.0044,
0.0044,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
3,
0,
0.024,
0.0262,
0,
0.66,
0.1,
633,
0,
0,
0,
0,
186,
0,
0
],
[
8,
1,
0.024,
0.0175,
1,
0.64,... | [
"from pyglet.gl import *",
"class DrawEnv(object):\n '''Sets up drawing environment.\n\n My have either or both of a \"before\" and \"after\" method.\n '''\n pass",
" '''Sets up drawing environment.\n\n My have either or both of a \"before\" and \"after\" method.\n '''",
"class DrawBlende... |
#!/usr/bin/env python
'''
Management of tile sets
=======================
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import xml.dom
import xml.dom.minidom
from scene2d.image import Image2d, Drawable
from resource import Resource, register_factory
from scene2d.drawable import *
@registe... | [
[
8,
0,
0.0476,
0.0476,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0857,
0.0095,
0,
0.66,
0.0909,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0952,
0.0095,
0,
0.66... | [
"'''\nManagement of tile sets\n=======================\n\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import xml.dom",
"import xml.dom.minidom",
"from scene2d.image import Image2d, Drawable",
"from resource import Resource, register_factory",
"from scene2d.drawa... |
"""
"""
from scene2d.map import RectMap, HexMap, RectCell, HexCell
from scene2d.camera import FlatCamera
from scene2d.view import FlatView, ViewScrollHandler
from scene2d.sprite import Sprite, RotatableSprite, SpriteLayer
from scene2d.image import Image2d
from scene2d.tile import TileSet, Tile
__all__ = [ 'RectMap', ... | [
[
8,
0,
0.1071,
0.1429,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2857,
0.0714,
0,
0.66,
0.1429,
830,
0,
4,
0,
0,
830,
0,
0
],
[
1,
0,
0.3571,
0.0714,
0,
0.66... | [
"\"\"\"\n\"\"\"",
"from scene2d.map import RectMap, HexMap, RectCell, HexCell",
"from scene2d.camera import FlatCamera",
"from scene2d.view import FlatView, ViewScrollHandler",
"from scene2d.sprite import Sprite, RotatableSprite, SpriteLayer",
"from scene2d.image import Image2d",
"from scene2d.tile impo... |
#!/usr/bin/env python
'''
Camera for projecting 2d flat scenes
====================================
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from pyglet.event import *
class Camera(object):
def project(self):
'''Set up the GL projection matrix. Leave us in GL_... | [
[
8,
0,
0.1087,
0.1087,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1957,
0.0217,
0,
0.66,
0.1667,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2174,
0.0217,
0,
0.66... | [
"'''\nCamera for projecting 2d flat scenes\n====================================\n\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"from pyglet.gl import *",
"from pyglet.event import *",
"class Camera(object):\n def project(self):\n '''Set up the GL projection matrix. Leave... |
#!/usr/bin/env python
'''
Support for loading XML resource files
======================================
This module provides the Resource class which loads XML resource files
which may contain scene2d image files, atlases, tile sets and maps.
---------------
Getting Started
---------------
Assuming the following XM... | [
[
8,
0,
0.2173,
0.4135,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4304,
0.0042,
0,
0.66,
0.1111,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4346,
0.0042,
0,
0.66... | [
"'''\nSupport for loading XML resource files\n======================================\n\nThis module provides the Resource class which loads XML resource files\nwhich may contain scene2d image files, atlases, tile sets and maps.\n\n---------------",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
... |
#!/usr/bin/env python
'''Testing a sprite.
The ball should bounce off the sides of the window. You may resize the
window.
This test should just run without failing.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import unittest
from pyglet.gl import glClear
import pyglet.window
import pygl... | [
[
8,
0,
0.0959,
0.0959,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1644,
0.0137,
0,
0.66,
0.0667,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1781,
0.0137,
0,
0.66... | [
"'''Testing a sprite.\n\nThe ball should bounce off the sides of the window. You may resize the\nwindow.\n\nThis test should just run without failing.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import unittest",
"from pyglet.gl import glClear",
"import pyglet.wind... |
#!/usr/bin/env python
'''Testing hex map debug rendering.
You should see a checkered hex map.
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from render_base import RenderBase
import scene2d
from scene2d.debug import gen_hex_map
cla... | [
[
8,
0,
0.2115,
0.2308,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3846,
0.0385,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4231,
0.0385,
0,
0.66,... | [
"'''Testing hex map debug rendering.\n\nYou should see a checkered hex map.\n\nPress escape or close the window to finish the test.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import unittest",
"from render_base import RenderBase",
"import scene2d",
"from scene2d.debug import g... |
#!/usr/bin/env python
'''Testing loading of a map.
You should see a simple map with a circular road on it.
The tiles are not well-designed :)
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import unittest
from render_base import RenderBase... | [
[
8,
0,
0.2069,
0.2414,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3793,
0.0345,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4138,
0.0345,
0,
0.66,... | [
"'''Testing loading of a map.\n\nYou should see a simple map with a circular road on it.\nThe tiles are not well-designed :)\n\nPress escape or close the window to finish the test.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import unittest",
"from render_base import... |
#!/usr/bin/env python
'''Testing mouse interaction
The cell the mouse is hovering over should highlight in red.
Clicking in a cell should highliht that cell green. Clicking again will
clear the highlighting.
Clicking on the ball sprite should highlight it and not underlying cells.
You may press the arrow keys to s... | [
[
8,
0,
0.1377,
0.2029,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2609,
0.0145,
0,
0.66,
0.0909,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2754,
0.0145,
0,
0.66... | [
"'''Testing mouse interaction\n\nThe cell the mouse is hovering over should highlight in red.\n\nClicking in a cell should highliht that cell green. Clicking again will\nclear the highlighting.\n\nClicking on the ball sprite should highlight it and not underlying cells.",
"__docformat__ = 'restructuredtext'",
"... |
#!/usr/bin/env python
'''Testing flat map allow_oob enforcement.
Press arrow keys to move view focal point (little ball) around map.
Press "o" to turn allow_oob on and off.
You should see no black border with allow_oob=False.
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtex... | [
[
8,
0,
0.1795,
0.2308,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3333,
0.0256,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.359,
0.0256,
0,
0.66,
... | [
"'''Testing flat map allow_oob enforcement.\n\nPress arrow keys to move view focal point (little ball) around map.\nPress \"o\" to turn allow_oob on and off.\n\nYou should see no black border with allow_oob=False.\n\nPress escape or close the window to finish the test.",
"__docformat__ = 'restructuredtext'",
"_... |
#!/usr/bin/env python
'''Testing rect map debug rendering.
You should see a checkered square grid.
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from render_base import RenderBase
import scene2d
from scene2d.debug import gen_rect_ma... | [
[
8,
0,
0.2115,
0.2308,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3846,
0.0385,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4231,
0.0385,
0,
0.66,... | [
"'''Testing rect map debug rendering.\n\nYou should see a checkered square grid.\n\nPress escape or close the window to finish the test.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import unittest",
"from render_base import RenderBase",
"import scene2d",
"from scene2d.debug imp... |
#!/usr/bin/env python
'''Testing flat map scrolling.
Press arrow keys to move view focal point (little ball) around map.
You will be able to move "off" the map.
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from render_base import ... | [
[
8,
0,
0.2321,
0.2857,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4286,
0.0357,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4643,
0.0357,
0,
0.66,... | [
"'''Testing flat map scrolling.\n\nPress arrow keys to move view focal point (little ball) around map.\n\nYou will be able to move \"off\" the map.\n\nPress escape or close the window to finish the test.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import unittest",
"from render_bas... |
#!/usr/bin/env python
'''Base class for rendering tests.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import unittest
from pyglet.gl import *
import pyglet.window
from pyglet.window.event import *
from pyglet.window import key
from pyglet import clock
from scene2d import *
from scene2d.draw... | [
[
8,
0,
0.0538,
0.0308,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0923,
0.0154,
0,
0.66,
0.0769,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1077,
0.0154,
0,
0.66... | [
"'''Base class for rendering tests.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import unittest",
"from pyglet.gl import *",
"import pyglet.window",
"from pyglet.window.event import *",
"from pyglet.window import key",
"from pyglet import clock",
"from scen... |
#!/usr/bin/env python
'''Testing mouse interaction
The cell the mouse is hovering over should highlight in red.
Clicking in a cell should highliht that cell green. Clicking again will
clear the highlighting.
Clicking on the ball sprite should highlight it and not underlying cells.
You may press the arrow keys to s... | [
[
8,
0,
0.1377,
0.2029,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2609,
0.0145,
0,
0.66,
0.0909,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2754,
0.0145,
0,
0.66... | [
"'''Testing mouse interaction\n\nThe cell the mouse is hovering over should highlight in red.\n\nClicking in a cell should highliht that cell green. Clicking again will\nclear the highlighting.\n\nClicking on the ball sprite should highlight it and not underlying cells.",
"__docformat__ = 'restructuredtext'",
"... |
#!/usr/bin/env python
'''Testing a sprite.
The ball should bounce off the sides of the window. You may resize the
window.
This test should just run without failing.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import unittest
from pyglet.gl import glClear
import pyglet.window
import pygle... | [
[
8,
0,
0.0968,
0.1129,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1774,
0.0161,
0,
0.66,
0.0769,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1935,
0.0161,
0,
0.66... | [
"'''Testing a sprite.\n\nThe ball should bounce off the sides of the window. You may resize the\nwindow.\n\nThis test should just run without failing.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import unittest",
"from pyglet.gl import glClear",
"import pyglet.wind... |
#!/usr/bin/env python
'''Testing loading of a map.
You should see a simple map with a circular road on it.
The tiles are not well-designed :)
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import unittest
from render_base import RenderBase... | [
[
8,
0,
0.2069,
0.2414,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3793,
0.0345,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4138,
0.0345,
0,
0.66,... | [
"'''Testing loading of a map.\n\nYou should see a simple map with a circular road on it.\nThe tiles are not well-designed :)\n\nPress escape or close the window to finish the test.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import unittest",
"from render_base import... |
#!/usr/bin/env python
'''Testing the map model.
This test should just run without failing.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from pyglet.window import Window
from scene2d import RectMap, HexMap, RectCell, HexCell
from scene2d.debug import gen_hex_map, gen_rect_map
rmd = [... | [
[
8,
0,
0.0177,
0.0157,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0315,
0.0039,
0,
0.66,
0.1,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0354,
0.0039,
0,
0.66,
... | [
"'''Testing the map model.\n\nThis test should just run without failing.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import unittest",
"from pyglet.window import Window",
"from scene2d import RectMap, HexMap, RectCell, HexCell",
"from scene2d.debug import gen_hex_map, gen_rect_... |
#!/usr/bin/env python
'''Testing the sprite model.
This test should just run without failing.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from pyglet.window import Window
from pyglet.image import SolidColorImagePattern
from scene2d import Sprite, Image2d
class SpriteModelTest(unitt... | [
[
8,
0,
0.0474,
0.0421,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0842,
0.0105,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0947,
0.0105,
0,
0.66,... | [
"'''Testing the sprite model.\n\nThis test should just run without failing.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import unittest",
"from pyglet.window import Window",
"from pyglet.image import SolidColorImagePattern",
"from scene2d import Sprite, Image2d",
"class Sprit... |
#!/usr/bin/env python
'''Testing flat map allow_oob enforcement.
Press 0-9 to set the size of the view in the window (1=10%, 0=100%)
Press arrow keys to move view focal point (little ball) around map.
Press "o" to turn allow_oob on and off.
You should see no black border with allow_oob=False.
Press escape or close... | [
[
8,
0,
0.1569,
0.2157,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2941,
0.0196,
0,
0.66,
0.0909,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3137,
0.0196,
0,
0.66... | [
"'''Testing flat map allow_oob enforcement.\n\nPress 0-9 to set the size of the view in the window (1=10%, 0=100%)\n\nPress arrow keys to move view focal point (little ball) around map.\nPress \"o\" to turn allow_oob on and off.\n\nYou should see no black border with allow_oob=False.",
"__docformat__ = 'restructu... |
# Lots Of Sprites
'''
Results (us per sprite per frame):
sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k
2000 28.3 29.3 20.6 22.0
after __slots__ removal
sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k
2000
'''
import os
import sys
import random
from pyglet ... | [
[
8,
0,
0.1,
0.1286,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1857,
0.0143,
0,
0.66,
0.0476,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2,
0.0143,
0,
0.66,
... | [
"'''\nResults (us per sprite per frame):\nsprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k\n2000 28.3 29.3 20.6 22.0\n\nafter __slots__ removal\nsprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k\n2000",
"import os",
"import sys",
"import random",
"from ... |
import sys
sys.path.insert(0, '/home/richard/src/pyglet.googlecode.com/trunk')
import os
import math
import pyglet.window
from resource import *
from pyglet.window import key
from pyglet import clock
from scene2d import *
from scene2d.textsprite import *
from pyglet import font
from layout import *
class RocketSpri... | [
[
1,
0,
0.0052,
0.0052,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0157,
0.0052,
0,
0.66,
0.0238,
368,
3,
2,
0,
0,
0,
0,
1
],
[
1,
0,
0.0262,
0.0052,
0,
0.... | [
"import sys",
"sys.path.insert(0, '/home/richard/src/pyglet.googlecode.com/trunk')",
"import os",
"import math",
"import pyglet.window",
"from resource import *",
"from pyglet.window import key",
"from pyglet import clock",
"from scene2d import *",
"from scene2d.textsprite import *",
"from pygle... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.window import Window
from pyglet import clock
from scene2d.textsprite import *
from pyglet import font
width, height = 640, 480
window = Window(width=width, height=height)
arial = font.load('Arial', 500, bold=True)
co... | [
[
8,
0,
0.0946,
0.0541,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1622,
0.027,
0,
0.66,
0.0556,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1892,
0.027,
0,
0.66,
... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"from pyglet.window import Window",
"from pyglet import clock",
"from scene2d.textsprite import *",
"from pyglet import font",
"width, height = 640, 480",
"window = Window(width=width, height=height)",
"arial = font.load('Ar... |
import os
import math
import pyglet.window
from pyglet.window.event import *
from pyglet.window import key
from pyglet import clock
from euclid import Vector2, Matrix3
from scene2d import *
class CarSprite(RotatableSprite):
def update(self, dt):
# handle input and move the car
self.angle += (keybo... | [
[
1,
0,
0.0196,
0.0196,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0392,
0.0196,
0,
0.66,
0.05,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0784,
0.0196,
0,
0.... | [
"import os",
"import math",
"import pyglet.window",
"from pyglet.window.event import *",
"from pyglet.window import key",
"from pyglet import clock",
"from euclid import Vector2, Matrix3",
"from scene2d import *",
"class CarSprite(RotatableSprite):\n def update(self, dt):\n # handle input ... |
#!/usr/bin/env python
'''Example of simple text wrapping without using layout.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from pyglet.window import Window
from pyglet.window import key
from pyglet import clock
from pyglet import font
from scene2d.textsprite import *
window =... | [
[
8,
0,
0.0686,
0.0392,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1176,
0.0196,
0,
0.66,
0.05,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1373,
0.0196,
0,
0.66,
... | [
"'''Example of simple text wrapping without using layout.\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"from pyglet.gl import *",
"from pyglet.window import Window",
"from pyglet.window import key",
"from pyglet import clock",
"from pyglet import font",
"from scene2d.textspri... |
import os
import math
import pyglet.window
from resource import *
from pyglet.window import key
from pyglet import clock
from scene2d import *
class PlayerSprite(Sprite):
bullets = []
def update(self, dt):
self.x += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * 200 * dt
if self.left < 0: self.l... | [
[
1,
0,
0.0097,
0.0097,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0194,
0.0097,
0,
0.66,
0.0435,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0388,
0.0097,
0,
... | [
"import os",
"import math",
"import pyglet.window",
"from resource import *",
"from pyglet.window import key",
"from pyglet import clock",
"from scene2d import *",
"class PlayerSprite(Sprite):\n bullets = []\n def update(self, dt):\n self.x += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * ... |
class Rect(object):
'''Define a rectangular area.
Many convenience handles and other properties are also defined - all of
which may be assigned to which will result in altering the position
and sometimes dimensions of the Rect.
The Rect area includes the bottom and left borders but not the top an... | [
[
3,
0,
0.5035,
0.9859,
0,
0.66,
0,
333,
0,
35,
0,
0,
186,
0,
19
],
[
8,
1,
0.0493,
0.0634,
1,
0.68,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
1,
0.1021,
0.0423,
1,
0.68,
... | [
"class Rect(object):\n '''Define a rectangular area.\n\n Many convenience handles and other properties are also defined - all of\n which may be assigned to which will result in altering the position\n and sometimes dimensions of the Rect.\n\n The Rect area includes the bottom and left borders but not... |
Blocker = object()
Start = False
End = object()
class Path(dict):
@classmethod
def determine_path(cls, field, width, height):
path = cls()
path.width = width
path.height = height
path.ends = set()
path.starts = []
cells = []
for y in range(height):
... | [
[
14,
0,
0.005,
0.005,
0,
0.66,
0,
454,
3,
0,
0,
0,
186,
10,
1
],
[
14,
0,
0.01,
0.005,
0,
0.66,
0.25,
620,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.0149,
0.005,
0,
0.66,
... | [
"Blocker = object()",
"Start = False",
"End = object()",
"class Path(dict):\n @classmethod\n def determine_path(cls, field, width, height):\n path = cls()\n path.width = width\n path.height = height\n path.ends = set()\n path.starts = []",
" def determine_path(cls... |
# desktop tower defense clone
import math
import random
from pyglet import window
from pyglet import image
from pyglet import resource
from pyglet import clock
from pyglet.window import mouse
import view
import tilemap
import spryte
import path
field_cells = '''
+++++++++++EEEEE++++++++++++
+##########.....########... | [
[
1,
0,
0.0052,
0.0026,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0078,
0.0026,
0,
0.66,
0.025,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0129,
0.0026,
0,
0... | [
"import math",
"import random",
"from pyglet import window",
"from pyglet import image",
"from pyglet import resource",
"from pyglet import clock",
"from pyglet.window import mouse",
"import view",
"import tilemap",
"import spryte",
"import path",
"field_cells = '''\n+++++++++++EEEEE++++++++++... |
# Lots Of Sprites
'''
Results for 2000 sprites:
platform us per sprite per frame
---------------------------------------------------------------------
Intel C2Quad Q6600 (2.4GHz), GeForce 7800 18.2478245656
Intel C2Duo T7500 (2.2GHz), GeForce 8400M GS 19.115903827
AMD 64 3500... | [
[
8,
0,
0.0926,
0.1235,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1728,
0.0123,
0,
0.66,
0.0357,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1852,
0.0123,
0,
0.66... | [
"'''\nResults for 2000 sprites:\n\nplatform us per sprite per frame\n---------------------------------------------------------------------\nIntel C2Quad Q6600 (2.4GHz), GeForce 7800 18.2478245656\nIntel C2Duo T7500 (2.2GHz), GeForce 8400M GS 19.115903827\nAMD 64 3500+ (1.8G... |
import sys
import random
import math
from pyglet import window
from pyglet import clock
from pyglet import resource
import spryte
NUM_CARS = 100
if len(sys.argv) > 1:
NUM_CARS = int(sys.argv[1])
win = window.Window(vsync=False)
fps = clock.ClockDisplay(color=(1, 1, 1, 1))
cars = spryte.SpriteBatch()
car = reso... | [
[
1,
0,
0.027,
0.027,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0541,
0.027,
0,
0.66,
0.0625,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0811,
0.027,
0,
0.66... | [
"import sys",
"import random",
"import math",
"from pyglet import window",
"from pyglet import clock",
"from pyglet import resource",
"import spryte",
"NUM_CARS = 100",
"if len(sys.argv) > 1:\n NUM_CARS = int(sys.argv[1])",
" NUM_CARS = int(sys.argv[1])",
"win = window.Window(vsync=False)"... |
import random
import math
from pyglet import window
from pyglet import image
from pyglet import clock
from pyglet import gl
from pyglet import resource
from pyglet.window import key
import spryte
win = window.Window(width=640, height=400,vsync=False)
fps = clock.ClockDisplay(color=(1, 1, 1, 1))
balls = spryte.Sprit... | [
[
1,
0,
0.01,
0.01,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.02,
0.01,
0,
0.66,
0.0333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.04,
0.01,
0,
0.66,
0.... | [
"import random",
"import math",
"from pyglet import window",
"from pyglet import image",
"from pyglet import clock",
"from pyglet import gl",
"from pyglet import resource",
"from pyglet.window import key",
"import spryte",
"win = window.Window(width=640, height=400,vsync=False)",
"fps = clock.Cl... |
import operator
from pyglet import gl, event
import spryte
import tilemap
class View(object):
'''Render a flat view of a scene2d.Scene.
Attributes:
scene -- a scene2d.Scene instance
allow_oob -- indicates whether the viewport will allow
viewing of ... | [
[
1,
0,
0.0048,
0.0048,
0,
0.66,
0,
616,
0,
1,
0,
0,
616,
0,
0
],
[
1,
0,
0.0144,
0.0048,
0,
0.66,
0.25,
182,
0,
2,
0,
0,
182,
0,
0
],
[
1,
0,
0.024,
0.0048,
0,
0.6... | [
"import operator",
"from pyglet import gl, event",
"import spryte",
"import tilemap",
"class View(object):\n '''Render a flat view of a scene2d.Scene.\n\n Attributes:\n\n scene -- a scene2d.Scene instance\n allow_oob -- indicates whether the viewport will allow\n ... |
import os
import math
from pyglet import image, gl, clock, graphics, sprite
class SpriteBatchGroup(graphics.Group):
def __init__(self, x, y, parent=None):
super(SpriteBatchGroup, self).__init__(parent)
self.x, self.y = x, y
def set(self):
if self.x or self.y:
gl.glTranslat... | [
[
1,
0,
0.0051,
0.0051,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0102,
0.0051,
0,
0.66,
0.1667,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0204,
0.0051,
0,
... | [
"import os",
"import math",
"from pyglet import image, gl, clock, graphics, sprite",
"class SpriteBatchGroup(graphics.Group):\n def __init__(self, x, y, parent=None):\n super(SpriteBatchGroup, self).__init__(parent)\n self.x, self.y = x, y\n\n def set(self):\n if self.x or self.y:\n... |
from pyglet import image
import spryte
class Map(spryte.SpriteBatch):
'''Rectangular map.
"cells" argument must be a row-major list of lists of Sprite instances.
'''
def set_cells(self, cell_width, cell_height, cells, origin=None):
self.cell_width, self.cell_height = cell_width, cell_height
... | [
[
1,
0,
0.0116,
0.0116,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0349,
0.0116,
0,
0.66,
0.5,
37,
0,
1,
0,
0,
37,
0,
0
],
[
3,
0,
0.5233,
0.9419,
0,
0.66,... | [
"from pyglet import image",
"import spryte",
"class Map(spryte.SpriteBatch):\n '''Rectangular map.\n\n \"cells\" argument must be a row-major list of lists of Sprite instances.\n '''\n def set_cells(self, cell_width, cell_height, cells, origin=None):\n self.cell_width, self.cell_height = cell... |
import os
import math
from pyglet import window
from pyglet import resource
from pyglet import image
from pyglet.window import key
from pyglet import clock
import spryte
import view
win = window.Window(vsync=False)
fps = clock.ClockDisplay(color=(1, 1, 1, 1))
map = [
[ 0, 1, 1, 1, 2, 3],
[ 5, 6, 16, 1... | [
[
1,
0,
0.0143,
0.0143,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0286,
0.0143,
0,
0.66,
0.0357,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0571,
0.0143,
0,
... | [
"import os",
"import math",
"from pyglet import window",
"from pyglet import resource",
"from pyglet import image",
"from pyglet.window import key",
"from pyglet import clock",
"import spryte",
"import view",
"win = window.Window(vsync=False)",
"fps = clock.ClockDisplay(color=(1, 1, 1, 1))",
"... |
import sys
import random
from pyglet import window
from pyglet import image
from pyglet import clock
from pyglet import resource
import spryte
NUM_BOOMS = 20
if len(sys.argv) > 1:
NUM_BOOMS = int(sys.argv[1])
win = window.Window(vsync=False)
fps = clock.ClockDisplay(color=(1, 1, 1, 1))
explosions = spryte.Spri... | [
[
1,
0,
0.0208,
0.0208,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0.05,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0833,
0.0208,
0,
0.... | [
"import sys",
"import random",
"from pyglet import window",
"from pyglet import image",
"from pyglet import clock",
"from pyglet import resource",
"import spryte",
"NUM_BOOMS = 20",
"if len(sys.argv) > 1:\n NUM_BOOMS = int(sys.argv[1])",
" NUM_BOOMS = int(sys.argv[1])",
"win = window.Windo... |
'''
Code by Richard Jones, released into the public domain.
Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game)
'''
import sys
import math
import euclid
import primitives
import pyglet
from pyglet.window import key
from pyglet.gl import *
window = pyglet.window.Window(fullscreen='-fs' in ... | [
[
8,
0,
0.0179,
0.0298,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0357,
0.006,
0,
0.66,
0.0588,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0417,
0.006,
0,
0.66,
... | [
"'''\nCode by Richard Jones, released into the public domain.\n\nBeginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game)\n'''",
"import sys",
"import math",
"import euclid",
"import primitives",
"import pyglet",
"from pyglet.window import key",
"from pyglet.gl import *",
"windo... |
import math
import pyglet
from pyglet.gl import *
class SmoothLineGroup(pyglet.graphics.Group):
def set_state(self):
glPushAttrib(GL_ENABLE_BIT)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_LINE_SMOOTH)
glLineWidth(2)
def unset_state... | [
[
1,
0,
0.025,
0.025,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.075,
0.025,
0,
0.66,
0.25,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.1,
0.025,
0,
0.66,
... | [
"import math",
"import pyglet",
"from pyglet.gl import *",
"class SmoothLineGroup(pyglet.graphics.Group):\n def set_state(self):\n glPushAttrib(GL_ENABLE_BIT)\n glEnable(GL_BLEND)\n glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n glEnable(GL_LINE_SMOOTH)\n glLineWidth... |
'''
Code by Richard Jones, released into the public domain.
Inspired by http://screamyguy.net/lines/index.htm
This code uses a single drawing buffer so that successive drawing passes
may be used to create the line fading effect. The fading is achieved
by drawing a translucent black quad over the entire scene before d... | [
[
8,
0,
0.0693,
0.1287,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1584,
0.0099,
0,
0.66,
0.0714,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1683,
0.0099,
0,
0.66... | [
"'''\nCode by Richard Jones, released into the public domain.\n\nInspired by http://screamyguy.net/lines/index.htm\n\nThis code uses a single drawing buffer so that successive drawing passes\nmay be used to create the line fading effect. The fading is achieved\nby drawing a translucent black quad over the entire sc... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: obj_test.py 111 2006-10-20 06:39:12Z r1chardj0n3s $'
import sys
import os
import ctypes
import pyglet
from pyglet.gl import *
from model import obj, geometric
w = pyglet.window.Window()
fourfv = ctypes.c_float * 4
glLightfv(GL_LI... | [
[
8,
0,
0.0593,
0.0339,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1017,
0.0169,
0,
0.66,
0.0417,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1186,
0.0169,
0,
0.66... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id: obj_test.py 111 2006-10-20 06:39:12Z r1chardj0n3s $'",
"import sys",
"import os",
"import ctypes",
"import pyglet",
"from pyglet.gl import *",
"from model import obj, geometric",
"w = pyglet.window.Window()",
"fourfv = ctypes... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: gl_tree_test.py 114 2006-10-22 09:46:11Z r1chardj0n3s $'
import math
import random
from pyglet.window import *
from pyglet.window import mouse
from pyglet import clock
from ctypes import *
from pyglet.window.event import *
from pygl... | [
[
8,
0,
0.0389,
0.0222,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0667,
0.0111,
0,
0.66,
0.037,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0778,
0.0111,
0,
0.66,... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id: gl_tree_test.py 114 2006-10-22 09:46:11Z r1chardj0n3s $'",
"import math",
"import random",
"from pyglet.window import *",
"from pyglet.window import mouse",
"from pyglet import clock",
"from ctypes import *",
"from pyglet.windo... |
import os
import warnings
from pyglet.gl import *
from pyglet import image
class Material(object):
diffuse = [.8, .8, .8]
ambient = [.2, .2, .2]
specular = [0., 0., 0.]
emission = [0., 0., 0.]
shininess = 0.
opacity = 1.
texture = None
def __init__(self, name):
self.name = nam... | [
[
1,
0,
0.0048,
0.0048,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0095,
0.0048,
0,
0.66,
0.1429,
358,
0,
1,
0,
0,
358,
0,
0
],
[
1,
0,
0.019,
0.0048,
0,
0... | [
"import os",
"import warnings",
"from pyglet.gl import *",
"from pyglet import image",
"class Material(object):\n diffuse = [.8, .8, .8]\n ambient = [.2, .2, .2]\n specular = [0., 0., 0.]\n emission = [0., 0., 0.]\n shininess = 0.\n opacity = 1.\n texture = None",
" diffuse = [.8, ... |
import math
import random
from pyglet.gl import *
import euclid
M_2PI = math.pi * 2.0
class DisplayList(int):
def draw(self):
glCallList(self)
def _TRI((v1, n1, t1, b1), (v2, n2, t2, b2), (v3, n3, t3, b3)):
glNormal3f(n1[0], n1[1], n1[2]); glVertex3f(v1[0], v1[1], v1[2])
glNormal3f(n2[0], n2[1],... | [
[
1,
0,
0.0066,
0.0066,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0132,
0.0066,
0,
0.66,
0.0588,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0265,
0.0066,
0,
... | [
"import math",
"import random",
"from pyglet.gl import *",
"import euclid",
"M_2PI = math.pi * 2.0",
"class DisplayList(int):\n def draw(self):\n glCallList(self)\n\n glNormal3f(n1[0], n1[1], n1[2]); glVertex3f(v1[0], v1[1], v1[2])\n glNormal3f(n2[0], n2[1], n2[2]); glVertex3f(v2[0], v2[1]... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: //depot/task/DEV-99/client/tests.py#13 $'
import sys
sys.path.insert(0, '../../')
sys.path.insert(0, '../layout/')
from pyglet.window import *
from pyglet import clock
from pyglet.gl import *
from pyglet import media
import layout... | [
[
8,
0,
0.0143,
0.0082,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0245,
0.0041,
0,
0.66,
0.0455,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0286,
0.0041,
0,
0.66... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id: //depot/task/DEV-99/client/tests.py#13 $'",
"import sys",
"sys.path.insert(0, '../../')",
"sys.path.insert(0, '../layout/')",
"from pyglet.window import *",
"from pyglet import clock",
"from pyglet.gl import *",
"from pyglet im... |
import os
from pyglet import image
_data = {}
filename = os.path.join
dirname = os.path.dirname(__file__)
def load_gui_image(filename):
if not os.path.isabs(filename):
filename = os.path.join(dirname, 'data', filename)
return load_image(filename)
def load_image(*filename):
filename = os.path.jo... | [
[
1,
0,
0.05,
0.05,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.15,
0.05,
0,
0.66,
0.1667,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.25,
0.05,
0,
0.66,
0... | [
"import os",
"from pyglet import image",
"_data = {}",
"filename = os.path.join",
"dirname = os.path.dirname(__file__)",
"def load_gui_image(filename):\n if not os.path.isabs(filename):\n filename = os.path.join(dirname, 'data', filename)\n return load_image(filename)",
" if not os.path.... |
'''Clipboard implementation for OS X using Win32
Based on implementation from:
http://aspn.activestate.com/ASPN/Mail/Message/ctypes-users/1771866
'''
from ctypes import *
from pyglet.window.win32.constants import CF_TEXT, GHND
OpenClipboard = windll.user32.OpenClipboard
EmptyClipboard = windll.user32.EmptyClipboard
... | [
[
1,
0,
0.0294,
0.0294,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0588,
0.0294,
0,
0.66,
0.5,
239,
0,
2,
0,
0,
239,
0,
0
],
[
3,
0,
0.5441,
0.8824,
0,
0.6... | [
"from ctypes import *",
"from pyglet.window.win32.constants import CF_TEXT, GHND",
"class Win32Clipboard(object):\n\n def get_text(self):\n # XXX Doesn't handle CF_UNICODETEXT yet.\n if not IsClipboardFormatAvailable(CF_TEXT):\n return ''\n if not OpenClipboard(c_int(0)):\n ... |
'''Clipboard implementation for X11 using xlib.
'''
from ctypes import *
from pyglet import window
from pyglet.window.xlib import xlib
XA_PRIMARY = xlib.Atom(1)
XA_STRING = xlib.Atom(31)
CurrentTime = 0
AnyPropertyType = 0
class XlibClipboard(object):
def get_text(self):
display = window.get_platform().g... | [
[
8,
0,
0.0273,
0.0364,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0545,
0.0182,
0,
0.66,
0.1111,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0909,
0.0182,
0,
0.66... | [
"'''Clipboard implementation for X11 using xlib.\n'''",
"from ctypes import *",
"from pyglet import window",
"from pyglet.window.xlib import xlib",
"XA_PRIMARY = xlib.Atom(1)",
"XA_STRING = xlib.Atom(31)",
"CurrentTime = 0",
"AnyPropertyType = 0",
"class XlibClipboard(object):\n def get_text(self... |
'''Interaction with the Operating System text clipboard
'''
import sys
def get_text():
'''Get a string from the clipboard.
'''
return _clipboard.get_text()
def put_text(text):
'''Put the string onto the clipboard.
'''
return _clipboard.put_text(text)
# Try to determine which platform to use.... | [
[
8,
0,
0.0577,
0.0769,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1538,
0.0385,
0,
0.66,
0.25,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.2885,
0.1538,
0,
0.66,
... | [
"'''Interaction with the Operating System text clipboard\n'''",
"import sys",
"def get_text():\n '''Get a string from the clipboard.\n '''\n return _clipboard.get_text()",
" '''Get a string from the clipboard.\n '''",
" return _clipboard.get_text()",
"def put_text(text):\n '''Put the ... |
import sys
import xml.sax.saxutils
from pyglet.gl import *
from pyglet.window import mouse, key
from wydget import event, layouts, loadxml
from wydget.widgets.frame import Frame
from wydget.widgets.label import Label
class MenuItem(Label):
name = 'menu-item'
@event.default('menu-item')
def on_element_enter(item... | [
[
1,
0,
0.0101,
0.0101,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0202,
0.0101,
0,
0.66,
0.0769,
759,
0,
1,
0,
0,
759,
0,
0
],
[
1,
0,
0.0404,
0.0101,
0,
... | [
"import sys",
"import xml.sax.saxutils",
"from pyglet.gl import *",
"from pyglet.window import mouse, key",
"from wydget import event, layouts, loadxml",
"from wydget.widgets.frame import Frame",
"from wydget.widgets.label import Label",
"class MenuItem(Label):\n name = 'menu-item'",
" name = ... |
from wydget import anim
from wydget.widgets.frame import Frame
class Drawer(Frame):
'''A *transparent container* that may hide and expose its contents.
'''
name='drawer'
HIDDEN='hidden'
EXPOSED='exposed'
LEFT='left'
RIGHT='right'
TOP='top'
BOTTOM='bottom'
def __init__(self, pa... | [
[
1,
0,
0.0059,
0.0059,
0,
0.66,
0,
601,
0,
1,
0,
0,
601,
0,
0
],
[
1,
0,
0.0118,
0.0059,
0,
0.66,
0.25,
566,
0,
1,
0,
0,
566,
0,
0
],
[
3,
0,
0.1391,
0.2367,
0,
0.... | [
"from wydget import anim",
"from wydget.widgets.frame import Frame",
"class Drawer(Frame):\n '''A *transparent container* that may hide and expose its contents.\n '''\n name='drawer'\n\n HIDDEN='hidden'\n EXPOSED='exposed'\n LEFT='left'",
" '''A *transparent container* that may hide and e... |
from pyglet.gl import *
from pyglet import clock
from pyglet.window import mouse
from wydget import element, event, data, util, anim
from wydget.widgets.button import Button, RepeaterButton
from wydget.widgets.label import Label
from wydget.widgets.frame import Frame
class SliderCommon(Frame):
slider_size = 16
... | [
[
1,
0,
0.0028,
0.0028,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
1,
0,
0.0056,
0.0028,
0,
0.66,
0.0435,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0084,
0.0028,
0,
... | [
"from pyglet.gl import *",
"from pyglet import clock",
"from pyglet.window import mouse",
"from wydget import element, event, data, util, anim",
"from wydget.widgets.button import Button, RepeaterButton",
"from wydget.widgets.label import Label",
"from wydget.widgets.frame import Frame",
"class Slider... |
from pyglet.gl import *
from pyglet.window import mouse
from pyglet import media, clock
from wydget import element, event, util, data, layouts, anim
from wydget.widgets.frame import Frame
from wydget.widgets.label import Image, Label
from wydget.widgets.button import Button
class Movie(Frame):
name='movie'
de... | [
[
1,
0,
0.0051,
0.0051,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
1,
0,
0.0103,
0.0051,
0,
0.66,
0.0667,
503,
0,
1,
0,
0,
503,
0,
0
],
[
1,
0,
0.0154,
0.0051,
0,
... | [
"from pyglet.gl import *",
"from pyglet.window import mouse",
"from pyglet import media, clock",
"from wydget import element, event, util, data, layouts, anim",
"from wydget.widgets.frame import Frame",
"from wydget.widgets.label import Image, Label",
"from wydget.widgets.button import Button",
"class... |
from pyglet.gl import *
from pyglet import clock
from pyglet.window import key, mouse
from wydget import element, event, util, anim, data
class Checkbox(element.Element):
name='checkbox'
is_focusable = True
def __init__(self, parent, value=False, width=16, height=16, **kw):
self.parent = parent
... | [
[
1,
0,
0.02,
0.02,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
1,
0,
0.04,
0.02,
0,
0.66,
0.1667,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.06,
0.02,
0,
0.66,
0.... | [
"from pyglet.gl import *",
"from pyglet import clock",
"from pyglet.window import key, mouse",
"from wydget import element, event, util, anim, data",
"class Checkbox(element.Element):\n name='checkbox'\n is_focusable = True\n\n def __init__(self, parent, value=False, width=16, height=16, **kw):\n ... |
from wydget.widgets.button import Button, TextButton, RepeaterButton
from wydget.widgets.frame import Frame, TabbedFrame
from wydget.widgets.drawer import Drawer
from wydget.widgets.label import Image, Label, XHTML
from wydget.widgets.menu import MenuItem, PopupMenu
from wydget.widgets.movie import Movie
from wydget.wi... | [
[
1,
0,
0.0294,
0.0294,
0,
0.66,
0,
570,
0,
3,
0,
0,
570,
0,
0
],
[
1,
0,
0.0588,
0.0294,
0,
0.66,
0.0625,
566,
0,
2,
0,
0,
566,
0,
0
],
[
1,
0,
0.0882,
0.0294,
0,
... | [
"from wydget.widgets.button import Button, TextButton, RepeaterButton",
"from wydget.widgets.frame import Frame, TabbedFrame",
"from wydget.widgets.drawer import Drawer",
"from wydget.widgets.label import Image, Label, XHTML",
"from wydget.widgets.menu import MenuItem, PopupMenu",
"from wydget.widgets.mov... |
import sys
import string
from pyglet.gl import *
from pyglet.window import key, mouse
from wydget import event, anim, util, element
from wydget.widgets.frame import Frame
from wydget.widgets.label import Label
from wydget import clipboard
# for detecting words later
letters = set(string.letters)
class Cursor(elemen... | [
[
1,
0,
0.002,
0.002,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.004,
0.002,
0,
0.66,
0.0435,
890,
0,
1,
0,
0,
890,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
... | [
"import sys",
"import string",
"from pyglet.gl import *",
"from pyglet.window import key, mouse",
"from wydget import event, anim, util, element",
"from wydget.widgets.frame import Frame",
"from wydget.widgets.label import Label",
"from wydget import clipboard",
"letters = set(string.letters)",
"c... |
import os
from pyglet.gl import *
from pyglet.window import mouse
from pyglet import media, clock
from wydget import element, event, util, data, layouts
from wydget.widgets.frame import Frame
from wydget.widgets.label import Image, Label
from wydget.widgets.button import Button
class Music(Frame):
name='music'
... | [
[
1,
0,
0.0066,
0.0066,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0199,
0.0066,
0,
0.66,
0.0769,
531,
0,
1,
0,
0,
531,
0,
0
],
[
1,
0,
0.0265,
0.0066,
0,
... | [
"import os",
"from pyglet.gl import *",
"from pyglet.window import mouse",
"from pyglet import media, clock",
"from wydget import element, event, util, data, layouts",
"from wydget.widgets.frame import Frame",
"from wydget.widgets.label import Image, Label",
"from wydget.widgets.button import Button",... |
from pyglet.gl import *
from wydget import loadxml
from wydget import util
from wydget.widgets.label import Label
class Progress(Label):
name = 'progress'
def __init__(self, parent, value=0.0, show_value=True,
bar_color='gray', bgcolor=(.3, .3, .3, 1), color='white',
width=None, height... | [
[
1,
0,
0.0213,
0.0213,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
1,
0,
0.0638,
0.0213,
0,
0.66,
0.25,
601,
0,
1,
0,
0,
601,
0,
0
],
[
1,
0,
0.0851,
0.0213,
0,
0.... | [
"from pyglet.gl import *",
"from wydget import loadxml",
"from wydget import util",
"from wydget.widgets.label import Label",
"class Progress(Label):\n name = 'progress'\n def __init__(self, parent, value=0.0, show_value=True,\n bar_color='gray', bgcolor=(.3, .3, .3, 1), color='white',\n ... |
from pyglet.window import mouse
import event
def DragHandler(rule, buttons=mouse.LEFT):
class _DragHandler(object):
original_position = None
mouse_buttons = buttons
@event.select(rule)
def on_drag(self, widget, x, y, dx, dy, buttons, modifiers):
if not buttons & self.... | [
[
1,
0,
0.0625,
0.0312,
0,
0.66,
0,
503,
0,
1,
0,
0,
503,
0,
0
],
[
1,
0,
0.125,
0.0312,
0,
0.66,
0.5,
371,
0,
1,
0,
0,
371,
0,
0
],
[
2,
0,
0.5781,
0.8125,
0,
0.66... | [
"from pyglet.window import mouse",
"import event",
"def DragHandler(rule, buttons=mouse.LEFT):\n class _DragHandler(object):\n original_position = None\n mouse_buttons = buttons\n\n @event.select(rule)\n def on_drag(self, widget, x, y, dx, dy, buttons, modifiers):\n if ... |
import math
class RestartLayout(Exception):
'''During layout an element has mutated the scene (eg. through adding
scrollbars) and thus layout must be restarted).
'''
def parse_value(value, base_value=0):
'''Parse a numeric value spec which is one of:
NNN integer
NN.MMM float
... | [
[
1,
0,
0.0025,
0.0025,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
3,
0,
0.0114,
0.0102,
0,
0.66,
0.1,
868,
0,
0,
0,
0,
645,
0,
0
],
[
8,
1,
0.0127,
0.0076,
1,
0.4... | [
"import math",
"class RestartLayout(Exception):\n '''During layout an element has mutated the scene (eg. through adding\n scrollbars) and thus layout must be restarted).\n '''",
" '''During layout an element has mutated the scene (eg. through adding\n scrollbars) and thus layout must be restarted... |
import os, sys
from wydget import event, widgets, layouts
from wydget.dialogs import base
if sys.platform == 'darwin':
default_dir = os.path.expanduser('~/Desktop')
elif sys.platform in ('win32', 'cygwin'):
default_dir = 'c:/'
else:
default_dir = os.path.expanduser('~/Desktop')
class FileOpen(base.Dialog... | [
[
1,
0,
0.0074,
0.0074,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0221,
0.0074,
0,
0.66,
0.1111,
601,
0,
3,
0,
0,
601,
0,
0
],
[
1,
0,
0.0294,
0.0074,
0,
... | [
"import os, sys",
"from wydget import event, widgets, layouts",
"from wydget.dialogs import base",
"if sys.platform == 'darwin':\n default_dir = os.path.expanduser('~/Desktop')\nelif sys.platform in ('win32', 'cygwin'):\n default_dir = 'c:/'\nelse:\n default_dir = os.path.expanduser('~/Desktop')",
... |
from wydget import event
from wydget import widgets
from wydget import layouts
from wydget.dialogs import base
class Question(base.Dialog):
id = '-question-dialog'
name = 'question-dialog'
classes = ('dialog', )
def __init__(self, parent, text, callback=None, cancel=True,
font_size=None, p... | [
[
1,
0,
0.0167,
0.0167,
0,
0.66,
0,
601,
0,
1,
0,
0,
601,
0,
0
],
[
1,
0,
0.0333,
0.0167,
0,
0.66,
0.1429,
601,
0,
1,
0,
0,
601,
0,
0
],
[
1,
0,
0.05,
0.0167,
0,
0.... | [
"from wydget import event",
"from wydget import widgets",
"from wydget import layouts",
"from wydget.dialogs import base",
"class Question(base.Dialog):\n id = '-question-dialog'\n name = 'question-dialog'\n classes = ('dialog', )\n\n def __init__(self, parent, text, callback=None, cancel=True,\... |
from wydget import widgets, event
class Dialog(widgets.Frame):
def __init__(self, parent, x=0, y=0, z=0, width=None, height=None,
classes=(), border='black', bgcolor='white', padding=2, **kw):
if 'dialog' not in classes:
classes = ('dialog', ) + classes
super(Dialog, self).... | [
[
1,
0,
0.0588,
0.0294,
0,
0.66,
0,
601,
0,
2,
0,
0,
601,
0,
0
],
[
3,
0,
0.4559,
0.7059,
0,
0.66,
0.5,
814,
0,
3,
0,
0,
937,
0,
5
],
[
2,
1,
0.2353,
0.2059,
1,
0.1... | [
"from wydget import widgets, event",
"class Dialog(widgets.Frame):\n def __init__(self, parent, x=0, y=0, z=0, width=None, height=None,\n classes=(), border='black', bgcolor='white', padding=2, **kw):\n if 'dialog' not in classes:\n classes = ('dialog', ) + classes\n super(D... |
from wydget.dialogs.question import Question, Message
from wydget.dialogs.file import FileOpen
| [
[
1,
0,
0.6667,
0.3333,
0,
0.66,
0,
703,
0,
2,
0,
0,
703,
0,
0
],
[
1,
0,
1,
0.3333,
0,
0.66,
1,
634,
0,
1,
0,
0,
634,
0,
0
]
] | [
"from wydget.dialogs.question import Question, Message",
"from wydget.dialogs.file import FileOpen"
] |
import operator
import math
from wydget import util
from wydget.widgets.label import Label
TOP = 'top'
BOTTOM = 'bottom'
LEFT = 'left'
RIGHT = 'right'
CENTER = 'center'
FILL = 'fill'
intceil = lambda i: int(math.ceil(i))
class Layout(object):
'''Absolute positioning layout -- also base class for other layouts.
... | [
[
1,
0,
0.0022,
0.0022,
0,
0.66,
0,
616,
0,
1,
0,
0,
616,
0,
0
],
[
1,
0,
0.0044,
0.0022,
0,
0.66,
0.0588,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0087,
0.0022,
0,
... | [
"import operator",
"import math",
"from wydget import util",
"from wydget.widgets.label import Label",
"TOP = 'top'",
"BOTTOM = 'bottom'",
"LEFT = 'left'",
"RIGHT = 'right'",
"CENTER = 'center'",
"FILL = 'fill'",
"intceil = lambda i: int(math.ceil(i))",
"class Layout(object):\n '''Absolute ... |
'''Define the core `Element` class from which all gui widgets are derived.
All gui elements have:
- the parent widget
- an id, element name and list of classes
- a list of children widgets
- a position in 3D space, relative to their parent's position
- dimensions available as width, height, rect and inner_rect
- scal... | [
[
8,
0,
0.0516,
0.1014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1031,
0.0017,
0,
0.66,
0.125,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.1049,
0.0017,
0,
0.66,... | [
"'''Define the core `Element` class from which all gui widgets are derived.\n\nAll gui elements have:\n\n- the parent widget\n- an id, element name and list of classes\n- a list of children widgets\n- a position in 3D space, relative to their parent's position",
"import inspect",
"import math",
"from pyglet.g... |
import math
from pyglet import clock
linear = lambda t: t
cosine90 = lambda t: 1-math.cos(t * math.pi/2)
cosine180 = lambda t: 1-abs(math.cos(t * math.pi))
exponential = lambda t: (math.exp(t)-1) / (math.exp(1)-1)
half_parabola = lambda t: (1000*t)**2 / 1000**2
inverted_half_parabola = lambda t: 1-((1000*t)**2 / 1000... | [
[
1,
0,
0.0056,
0.0056,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0167,
0.0056,
0,
0.66,
0.0588,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.0278,
0.0056,
0,
... | [
"import math",
"from pyglet import clock",
"linear = lambda t: t",
"cosine90 = lambda t: 1-math.cos(t * math.pi/2)",
"cosine180 = lambda t: 1-abs(math.cos(t * math.pi))",
"exponential = lambda t: (math.exp(t)-1) / (math.exp(1)-1)",
"half_parabola = lambda t: (1000*t)**2 / 1000**2",
"inverted_half_para... |
from pyglet.gl import *
from pyglet import font
from layout import *
import util
class Style(object):
font_name = ''
font_size = 14
def getFont(self, name=None, size=None):
if name is None: name = self.font_name
if size is None: size = self.font_size
return font.load(name, size)... | [
[
1,
0,
0.0138,
0.0069,
0,
0.66,
0,
531,
0,
1,
0,
0,
531,
0,
0
],
[
1,
0,
0.0207,
0.0069,
0,
0.66,
0.1667,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0276,
0.0069,
0,
... | [
"from pyglet.gl import *",
"from pyglet import font",
"from layout import *",
"import util",
"class Style(object):\n\n font_name = ''\n font_size = 14\n\n def getFont(self, name=None, size=None):\n if name is None: name = self.font_name\n if size is None: size = self.font_size",
" ... |
'''Usage: %s <arguments>
-h h draw hexes with given height in a rectangular grid
-x h draw hexes with given height in a hex grid
-r w[,h] draw a rect grid
-s w,h map size in cells (default=5,5)
-f render flat (default)
-o render orthographic projection
-... | [
[
1,
0,
0.0476,
0.0476,
0,
0.66,
0,
509,
0,
3,
0,
0,
509,
0,
0
],
[
1,
0,
0.1429,
0.0476,
0,
0.66,
0.1429,
658,
0,
1,
0,
0,
658,
0,
0
],
[
1,
0,
0.1905,
0.0476,
0,
... | [
"import sys, getopt, os",
"import pyglet.ext.scene2d",
"import pyglet.window",
"import pyglet.window.event",
"from pyglet import clock",
"import pyglet.image",
"from pyglet.ext.scene2d.debug import gen_hex_map, gen_rect_map, gen_recthex_map",
"class SaveHandler:\n def on_text(self, text):\n ... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import shutil
import sys
import time
from xml.dom.minidom import parse
try:
from xml.etree import ElementTree
except ImportError:
from elementtree import ElementTree
def get_elem_by_id(doc, name, id):
for el... | [
[
8,
0,
0.0241,
0.0138,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0414,
0.0069,
0,
0.66,
0.0833,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0483,
0.0069,
0,
0.66... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import shutil",
"import sys",
"import time",
"from xml.dom.minidom import parse",
"try:\n from xml.etree import ElementTree\nexcept ImportError:\n from elementtree import ElementTree",
" from xml.etree... |
#!/usr/bin/env python
'''Generate PDF documentation
Requires docutils, docbook XSL stylesheets, xsltproc and Apache FOP (with
Batik).
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import shutil
import subprocess
from xml.dom.minidom import parse
from docutils.core import publish_doctree, pu... | [
[
8,
0,
0.0266,
0.0266,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0479,
0.0053,
0,
0.66,
0.0625,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0532,
0.0053,
0,
0.66... | [
"'''Generate PDF documentation\n\nRequires docutils, docbook XSL stylesheets, xsltproc and Apache FOP (with\nBatik).\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import shutil",
"import subprocess",
"from xml.dom.minidom import parse",
"from docutils.core import p... |
# epydoc -- Backwards compatibility
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: util.py 956 2006-03-10 01:30:51Z edloper $
"""
Backwards compatibility with previous versions of Python.
This module provides backwards compatibility by defining se... | [
[
8,
0,
0.056,
0.044,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.08,
0.004,
0,
0.66,
0.25,
959,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.12,
0.028,
0,
0.66,
0.5,
... | [
"\"\"\"\nBackwards compatibility with previous versions of Python.\n\nThis module provides backwards compatibility by defining several\nfunctions and classes that were not available in earlier versions of\nPython. Intented usage:\n\n >>> from epydoc.compat import *",
"__docformat__ = 'epytext'",
"try:\n ... |
#
# objdoc: epydoc documentation completeness checker
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: checker.py 1366 2006-09-07 15:54:59Z edloper $
#
"""
Documentation completeness checker. This module defines a single
class, C{DocChecker}, which can be used to check the that specified
classes of objects are d... | [
[
8,
0,
0.0315,
0.0143,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0401,
0.0029,
0,
0.66,
0.1111,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0573,
0.0029,
0,
0.66,... | [
"\"\"\"\nDocumentation completeness checker. This module defines a single\nclass, C{DocChecker}, which can be used to check the that specified\nclasses of objects are documented.\n\"\"\"",
"__docformat__ = 'epytext en'",
"import re, sys, os.path, string",
"from xml.dom.minidom import Text as _Text",
"from ... |
#
# epydoc.py: epydoc LaTeX output generator
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: latex.py 1479 2007-02-13 22:01:15Z edloper $
#
"""
The LaTeX output generator for epydoc. The main interface provided by
this module is the L{LatexWriter} class.
@todo: Inheritance=listed
"""
__docformat__ = 'epytext e... | [
[
8,
0,
0.0114,
0.006,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0149,
0.001,
0,
0.66,
0.1,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0169,
0.001,
0,
0.66,
0... | [
"\"\"\"\nThe LaTeX output generator for epydoc. The main interface provided by\nthis module is the L{LatexWriter} class.\n\n@todo: Inheritance=listed\n\"\"\"",
"__docformat__ = 'epytext en'",
"import os.path, sys, time, re, textwrap, codecs",
"from epydoc.apidoc import *",
"from epydoc.compat import *",
... |
#
# epydoc.css: default epydoc CSS stylesheets
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: html_css.py 1517 2007-02-16 06:13:56Z edloper $
#
"""
Predefined CSS stylesheets for the HTML outputter (L{epydoc.docwriter.html}).
@type STYLESHEETS: C{dictionary} from C{string} to C{(string, string)}
@var STYLESHEE... | [
[
8,
0,
0.0306,
0.0296,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0463,
0.0019,
0,
0.66,
0.0625,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.05,
0.0019,
0,
0.66,
... | [
"\"\"\"\nPredefined CSS stylesheets for the HTML outputter (L{epydoc.docwriter.html}).\n\n@type STYLESHEETS: C{dictionary} from C{string} to C{(string, string)}\n@var STYLESHEETS: A dictionary mapping from stylesheet names to CSS\n stylesheets and descriptions. A single stylesheet may have\n multiple names. ... |
#
# epydoc.css: default help page
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: html_help.py 1239 2006-07-05 11:29:50Z edloper $
#
"""
Default help file for the HTML outputter (L{epydoc.docwriter.html}).
@type HTML_HELP: C{string}
@var HTML_HELP: The contents of the HTML body for the default
help page.
"""
__... | [
[
8,
0,
0.0632,
0.0368,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0842,
0.0053,
0,
0.66,
0.5,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.55,
0.9053,
0,
0.66,
... | [
"\"\"\"\nDefault help file for the HTML outputter (L{epydoc.docwriter.html}).\n\n@type HTML_HELP: C{string}\n@var HTML_HELP: The contents of the HTML body for the default\nhelp page.\n\"\"\"",
"__docformat__ = 'epytext en'",
"HTML_HELP = '''\n<h1 class=\"epydoc\"> API Documentation </h1>\n\n<p> This document co... |
# epydoc -- Output generation
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: __init__.py 956 2006-03-10 01:30:51Z edloper $
"""
Output generation.
"""
__docformat__ = 'epytext en'
| [
[
8,
0,
0.8333,
0.25,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
1,
0.0833,
0,
0.66,
1,
959,
1,
0,
0,
0,
0,
3,
0
]
] | [
"\"\"\"\nOutput generation.\n\"\"\"",
"__docformat__ = 'epytext en'"
] |
#
# doctest.py: Syntax Highlighting for doctest blocks
# Edward Loper
#
# Created [06/28/03 02:52 AM]
# $Id: restructuredtext.py 1210 2006-04-10 13:25:50Z edloper $
#
"""
Syntax highlighting for doctest blocks. This module defines two
functions, L{doctest_to_html()} and L{doctest_to_latex()}, which can
be used to per... | [
[
8,
0,
0.0418,
0.0289,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0579,
0.0032,
0,
0.66,
0.1,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0643,
0.0032,
0,
0.66,
... | [
"\"\"\"\nSyntax highlighting for doctest blocks. This module defines two\nfunctions, L{doctest_to_html()} and L{doctest_to_latex()}, which can\nbe used to perform syntax highlighting on doctest blocks. It also\ndefines the more general C{colorize_doctest()}, which could be used to\ndo syntac highlighting on docte... |
#
# javadoc.py: javadoc docstring parsing
# Edward Loper
#
# Created [07/03/03 12:37 PM]
# $Id: javadoc.py 1444 2007-02-10 19:26:54Z dvarrazzo $
#
"""
Epydoc parser for U{Javadoc<http://java.sun.com/j2se/javadoc/>}
docstrings. Javadoc is an HTML-based markup language that was
developed for documenting Java APIs with ... | [
[
8,
0,
0.1028,
0.1371,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1734,
0.004,
0,
0.66,
0.1667,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1855,
0.004,
0,
0.66,
... | [
"\"\"\"\nEpydoc parser for U{Javadoc<http://java.sun.com/j2se/javadoc/>}\ndocstrings. Javadoc is an HTML-based markup language that was\ndeveloped for documenting Java APIs with inline comments. It consists\nof raw HTML, augmented by Javadoc tags. There are two types of\nJavadoc tag:\n\n - X{Javadoc block tags}... |
# epydoc -- Marked-up Representations for Python Values
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: apidoc.py 1448 2007-02-11 00:05:34Z dvarrazzo $
"""
Syntax highlighter for Python values. Currently provides special
colorization support for:
... | [
[
8,
0,
0.0342,
0.0361,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0532,
0.0019,
0,
0.66,
0.0667,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0646,
0.0019,
0,
0.66,... | [
"\"\"\"\nSyntax highlighter for Python values. Currently provides special\ncolorization support for:\n\n - lists, tuples, sets, frozensets, dicts\n - numbers\n - strings\n - compiled regexps",
"__docformat__ = 'epytext en'",
"import types, re",
"import epydoc.apidoc",
"from epydoc.util import decode_wi... |
#
# plaintext.py: plaintext docstring parsing
# Edward Loper
#
# Created [04/10/01 12:00 AM]
# $Id: plaintext.py 1444 2007-02-10 19:26:54Z dvarrazzo $
#
"""
Parser for plaintext docstrings. Plaintext docstrings are rendered as
verbatim output, preserving all whitespace.
"""
__docformat__ = 'epytext en'
from epydoc.m... | [
[
8,
0,
0.14,
0.0533,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1733,
0.0133,
0,
0.66,
0.2,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2,
0.0133,
0,
0.66,
0.4... | [
"\"\"\"\nParser for plaintext docstrings. Plaintext docstrings are rendered as\nverbatim output, preserving all whitespace.\n\"\"\"",
"__docformat__ = 'epytext en'",
"from epydoc.markup import *",
"from epydoc.util import plaintext_to_html, plaintext_to_latex",
"def parse_docstring(docstring, errors, **opt... |
# epydoc
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: __init__.py 1558 2007-02-27 05:28:35Z edloper $
"""
Automatic Python reference documentation generator. Epydoc processes
Python modules and docstrings to generate formatted API documentation,... | [
[
8,
0,
0.4604,
0.8458,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.8855,
0.0044,
0,
0.66,
0.0909,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.8943,
0.0044,
0,
0.66... | [
"\"\"\"\nAutomatic Python reference documentation generator. Epydoc processes\nPython modules and docstrings to generate formatted API documentation,\nin the form of HTML pages. Epydoc can be used via a command-line\ninterface (`epydoc.cli`) and a graphical interface (`epydoc.gui`).\nBoth interfaces let the user ... |
#
# epydoc -- Utility functions used by regression tests (*.doctest)
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: html.py 1420 2007-01-28 14:19:30Z dvarrazzo $
#
"""
Utility functions used by the regression tests (C{*.doctest}).
"""
__docformat__ = 'epytext en'
import tempfile, re, os, os.path, textwrap, sys... | [
[
8,
0,
0.0442,
0.0133,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0531,
0.0044,
0,
0.66,
0.05,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0619,
0.0044,
0,
0.66,
... | [
"\"\"\"\nUtility functions used by the regression tests (C{*.doctest}).\n\"\"\"",
"__docformat__ = 'epytext en'",
"import tempfile, re, os, os.path, textwrap, sys",
"from epydoc.docbuilder import build_doc, build_doc_index",
"from epydoc.docparser import parse_docs",
"from epydoc.docintrospecter import in... |
# epydoc -- Regression testing
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: __init__.py 1502 2007-02-14 08:38:44Z edloper $
"""
Regression testing.
"""
__docformat__ = 'epytext en'
import unittest, doctest, epydoc, os, os.path, re, sys
def main... | [
[
8,
0,
0.1031,
0.0309,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1237,
0.0103,
0,
0.66,
0.2,
959,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1443,
0.0103,
0,
0.66,
... | [
"\"\"\"\nRegression testing.\n\"\"\"",
"__docformat__ = 'epytext en'",
"import unittest, doctest, epydoc, os, os.path, re, sys",
"def main():\n try:\n doctest.register_optionflag\n except:\n print (\"\\n\"\n \"The regression test suite requires a more recent version of\\n\"\n ... |
#! /usr/bin/env python
#
# Edward Loper's API Documentation Generation Tool
#
# Created [05/27/01 09:04 PM]
# Edward Loper
#
from distutils.core import setup
import re, sys, epydoc
VERSION = str(epydoc.__version__)
(AUTHOR, EMAIL) = re.match('^(.*?)\s*<(.*)>$', epydoc.__author__).groups()
URL = epydoc.__url__
LICENSE... | [
[
1,
0,
0.2727,
0.0303,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.303,
0.0303,
0,
0.66,
0.125,
540,
0,
3,
0,
0,
540,
0,
0
],
[
14,
0,
0.3636,
0.0303,
0,
0... | [
"from distutils.core import setup",
"import re, sys, epydoc",
"VERSION = str(epydoc.__version__)",
"(AUTHOR, EMAIL) = re.match('^(.*?)\\s*<(.*)>$', epydoc.__author__).groups()",
"URL = epydoc.__url__",
"LICENSE = epydoc.__license__",
"if '--format=wininst' in sys.argv:\n SCRIPTS = ['scripts/epydoc.py... |
#!/usr/bin/env python
#
# Call the command line interface for Epydoc.
#
# Make sure that we don't get confused between an epydoc.py script and
# the real epydoc package.
import sys, os.path
if os.path.exists(os.path.join(sys.path[0], 'epydoc.py')):
del sys.path[0]
from epydoc.cli import cli
cli()
| [
[
1,
0,
0.5714,
0.0714,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
4,
0,
0.6786,
0.1429,
0,
0.66,
0.3333,
0,
3,
0,
0,
0,
0,
0,
2
],
[
1,
0,
0.8571,
0.0714,
0,
0.66... | [
"import sys, os.path",
"if os.path.exists(os.path.join(sys.path[0], 'epydoc.py')):\n del sys.path[0]",
"from epydoc.cli import cli",
"cli()"
] |
#!/usr/bin/python
#
# Call the graphical interface for Epydoc.
#
# We have to do some path magic to prevent Python from getting
# confused about the difference between this epydoc module, and the
# real epydoc package. So sys.path[0], which contains the directory
# of the script.
import sys, os.path
script_path = os.... | [
[
1,
0,
0.5882,
0.0588,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
0.25,
647,
3,
1,
0,
0,
142,
10,
1
],
[
14,
0,
0.7353,
0.1176,
0,
... | [
"import sys, os.path",
"script_path = os.path.abspath(sys.path[0])",
"sys.path = [p for p in sys.path if\n os.path.abspath(p) != script_path]",
"from epydoc.gui import gui",
"gui()"
] |
#!/usr/bin/python
#
# Call the graphical interface for Epydoc.
#
from epydoc.gui import gui
gui()
| [
[
1,
0,
0.8571,
0.1429,
0,
0.66,
0,
263,
0,
1,
0,
0,
263,
0,
0
],
[
8,
0,
1,
0.1429,
0,
0.66,
1,
22,
3,
0,
0,
0,
0,
0,
1
]
] | [
"from epydoc.gui import gui",
"gui()"
] |
#!/usr/bin/python
#
# Call the command line interface for Epydoc.
#
# We have to do some path magic to prevent Python from getting
# confused about the difference between this epydoc module, and the
# real epydoc package. So remove sys.path[0], which contains the
# directory of the script.
import sys, os.path
script_... | [
[
1,
0,
0.5882,
0.0588,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
0.25,
647,
3,
1,
0,
0,
142,
10,
1
],
[
14,
0,
0.7353,
0.1176,
0,
... | [
"import sys, os.path",
"script_path = os.path.abspath(sys.path[0])",
"sys.path = [p for p in sys.path if\n os.path.abspath(p) != script_path]",
"from epydoc.cli import cli",
"cli()"
] |
#!/usr/bin/env python
#
# Copyright 2006 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
# uplo... | [
[
8,
0,
0.2197,
0.0101,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2323,
0.0051,
0,
0.66,
0.1,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2424,
0.0051,
0,
0.66,
... | [
"\"\"\"Google Code file uploader script.\n\"\"\"",
"__author__ = 'danderson@google.com (David Anderson)'",
"import httplib",
"import os.path",
"import optparse",
"import getpass",
"import base64",
"def upload(file, project_name, user_name, password, summary, labels=None):\n \"\"\"Upload a file to a G... |
#!/usr/bin/env python
'''Upload dist/ files to code.google.com. For Alex only :-)
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import re
import sys
base = os.path.dirname(__file__)
root = os.path.join(base, '../..')
dist = os.path.join(root, 'dist')
sys.path.insert(0, root)
import pyglet
... | [
[
8,
0,
0.0449,
0.0256,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0769,
0.0128,
0,
0.66,
0.0833,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0897,
0.0128,
0,
0.66... | [
"'''Upload dist/ files to code.google.com. For Alex only :-)\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import os",
"import re",
"import sys",
"base = os.path.dirname(__file__)",
"root = os.path.join(base, '../..')",
"dist = os.path.join(root, 'dist')",
"sys.path.insert... |
# 2. Create build/pyglet.wxs from pyglet.wxs, add all file components
# 3. Run candle and light on build/pyglet.wxs to generate
# ../../dist/pyglet.msi
import os
import re
import shutil
import subprocess
from uuid import uuid1
from xml.dom.minidom import parse
import pkg_resources
class PythonVersion... | [
[
1,
0,
0.0158,
0.0032,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.019,
0.0032,
0,
0.66,
0.0455,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0222,
0.0032,
0,
0... | [
"import os",
"import re",
"import shutil",
"import subprocess",
"from uuid import uuid1",
"from xml.dom.minidom import parse",
"import pkg_resources",
"class PythonVersion(object):\n def __init__(self, version, key_root, display_version):\n self.version = version\n self.display_versio... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from wraptypes.wrap import main as wrap
import os.path
import sys
import pyglet
pyglet.options['shadow_window'] = False
if __name__ == '__main__':
if not os.path.exists('pyglet/window'):
assert False, 'Run with CWD = ... | [
[
8,
0,
0.0347,
0.0198,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0594,
0.0099,
0,
0.66,
0.125,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0693,
0.0099,
0,
0.66,... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"from wraptypes.wrap import main as wrap",
"import os.path",
"import sys",
"import pyglet",
"pyglet.options['shadow_window'] = False",
"if __name__ == '__main__':\n if not os.path.exists('pyglet/window'):\n assert Fa... |
#!/usr/bin/env 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 ... | [
[
8,
0,
0.338,
0.0185,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3611,
0.0093,
0,
0.66,
0.0303,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3704,
0.0093,
0,
0.66,... | [
"'''\n'''",
"__docformat__ = 'restructuredtext'",
"__version__ = '$Id$'",
"import textwrap",
"import pyglet.window",
"from pyglet.gl import *",
"from pyglet.gl import gl_info",
"from pyglet.gl import glu_info",
"platform = pyglet.window.get_platform()",
"print('Platform instance is %r' % platform)... |
#!/usr/bin/env python
'''Print OpenAL driver information.
Options:
-d <device> Optionally specify device to query.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
import optparse
import sys
from pyglet.media.drivers import openal
from pyglet.media.drivers.openal import al
from pyglet.... | [
[
1,
0,
0.0417,
0.0417,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0.1667,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.125,
0.0417,
0,
0... | [
"import ctypes",
"import optparse",
"import sys",
"from pyglet.media.drivers import openal",
"from pyglet.media.drivers.openal import al",
"from pyglet.media.drivers.openal import alc",
"def split_nul_strings(s):\n # NUL-separated list of strings, double-NUL-terminated.\n nul = False\n i = 0\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.