<commit_before>#!/usr/bin/env python

'''
'''

__docformat__ = 'restructuredtext'
__version__ = '$Id$'

import textwrap

import pyglet.window
from pyglet.gl import *
from pyglet.gl.gl_info import *
from pyglet.gl.glu_info import *

platform = pyglet.window.get_platform()
print 'Platform instance is %r' % platform
factory = pyglet.window.get_factory()
print 'Screens:'
for screen in factory.get_screens():
    print '  %r' % screen

print 'Creating default context...'
w = pyglet.window.Window(1, 1, visible=False)

print 'GL attributes:'
order = ['buffer_size', 'doublebuffer', 'stereo', 'red_size', 'green_size',
    'blue_size', 'alpha_size', 'aux_buffers', 'depth_size', 'stencil_size',
    'accum_red_size', 'accum_green_size', 'accum_blue_size',
    'accum_alpha_size']
attrs = w.get_config().get_gl_attributes()
attrs = ' '.join(['%s=%s'%(i, attrs[i]) for i in order])
print '\n'.join(textwrap.wrap(attrs))

print 'GL version:', gl_info.get_version()
print 'GL vendor:', gl_info.get_vendor()
print 'GL renderer:', gl_info.get_renderer()
print 'GL extensions:'
exts = ' '.join(gl_info.get_extensions())
print ' ', '\n  '.join(textwrap.wrap(exts))

print 'GLU version:', glu_info.get_version()
print 'GLU extensions:'
exts = ' '.join(glu_info.get_extensions())
print ' ', '\n  '.join(textwrap.wrap(exts))

print

context = w.get_context()
print 'Context is', context

if context.__class__.__name__ == 'XlibGLContext':
    from pyglet.gl.glx_info import *
    print 'GLX %s direct'%(context.is_direct() and 'is' or 'is not')
    if not glx_info.have_version(1, 1):
        print "GLX server version: 1.0"
    else:
        print 'GLX server vendor:', glx_info.get_server_vendor()
        print 'GLX server version:', glx_info.get_server_version()
        print 'GLX server extensions:'
        exts = glx_info.get_server_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
        print 'GLX client vendor:', glx_info.get_client_vendor()
        print 'GLX client version:', glx_info.get_client_version()
        print 'GLX client extensions:'
        exts = glx_info.get_client_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
        print 'GLX extensions:'
        exts = glx_info.get_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
elif context.__class__.__name__ == 'Win32Context':
    from pyglet.gl.wgl_info import have_wgl_extension, get_wgl_extensions
    if have_wgl_extension('WGL_EXT_extensions_string'):
        wgl_extensions = get_wgl_extensions()
        print 'WGL extensions:'
        print '', '\n '.join(textwrap.wrap(' '.join(wgl_extensions)))
    else:
        print 'WGL_EXT_extensions_string extension not available.'

<commit_msg>Patch fixing info.py on Windows from shredwheat<commit_after>#!/usr/bin/env python

'''
'''

__docformat__ = 'restructuredtext'
__version__ = '$Id$'

import textwrap

import pyglet.window
from pyglet.gl import *
from pyglet.gl.gl_info import *
from pyglet.gl.glu_info import *

platform = pyglet.window.get_platform()
print 'Platform instance is %r' % platform
factory = pyglet.window.get_factory()
print 'Screens:'
for screen in factory.get_screens():
    print '  %r' % screen

print 'Creating default context...'
w = pyglet.window.Window(1, 1, visible=False)

print 'GL attributes:'
order = ['buffer_size', 'doublebuffer', 'stereo', 'red_size', 'green_size',
    'blue_size', 'alpha_size', 'aux_buffers', 'depth_size', 'stencil_size',
    'accum_red_size', 'accum_green_size', 'accum_blue_size',
    'accum_alpha_size']
attrs = w.get_config().get_gl_attributes()
attrs = ' '.join(['%s=%s'%(i, attrs[i]) for i in order])
print '\n'.join(textwrap.wrap(attrs))

print 'GL version:', gl_info.get_version()
print 'GL vendor:', gl_info.get_vendor()
print 'GL renderer:', gl_info.get_renderer()
print 'GL extensions:'
exts = ' '.join(gl_info.get_extensions())
print ' ', '\n  '.join(textwrap.wrap(exts))

print 'GLU version:', glu_info.get_version()
print 'GLU extensions:'
exts = ' '.join(glu_info.get_extensions())
print ' ', '\n  '.join(textwrap.wrap(exts))

print

context = w.get_context()
print 'Context is', context

if context.__class__.__name__ == 'XlibGLContext':
    from pyglet.gl.glx_info import *
    print 'GLX %s direct'%(context.is_direct() and 'is' or 'is not')
    if not glx_info.have_version(1, 1):
        print "GLX server version: 1.0"
    else:
        print 'GLX server vendor:', glx_info.get_server_vendor()
        print 'GLX server version:', glx_info.get_server_version()
        print 'GLX server extensions:'
        exts = glx_info.get_server_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
        print 'GLX client vendor:', glx_info.get_client_vendor()
        print 'GLX client version:', glx_info.get_client_version()
        print 'GLX client extensions:'
        exts = glx_info.get_client_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
        print 'GLX extensions:'
        exts = glx_info.get_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
elif context.__class__.__name__ == 'Win32Context':
    from pyglet.gl.wgl_info import wgl_info
    if wgl_info.have_extension('WGL_EXT_extensions_string'):
        wgl_extensions = wgl_info.get_extensions()
        print 'WGL extensions:'
        print '', '\n '.join(textwrap.wrap(' '.join(wgl_extensions)))
    else:
        print 'WGL_EXT_extensions_string extension not available.'


{'fraction_non_alphanumeric': 0.14947138169886984, 'fraction_numerical': 0.002916514764855997, 'mean_word_length': 4.085264133456905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7435405', 'n_tokens_mistral': 1913, 'n_tokens_neox': 1884, 'n_words': 431}