File: glinfo.py

package info (click to toggle)
python-visual 3.2.9-4.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,796 kB
  • ctags: 2,664
  • sloc: cpp: 11,958; sh: 8,185; python: 3,709; ansic: 480; makefile: 311
file content (32 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from visual import *
import sys, os, time

print "This test of OpenGL options is useful mainly on Windows."
print

def print_mtime(f):
    try:
        print "  %-30s %s" % (f, time.ctime(os.path.getmtime(f)))
    except:
        pass

tried = {}
paths = sys.path
try:
    windir = os.environ['windir']
    paths = paths + [os.path.join(windir,'system'),
                     os.path.join(windir,'system32')]
except:
    print 'Windows directory not found.'

for dir in paths:
    for file in ['cvisual.dll', 'visual\\__init__.py', 'visual\\graph.py', 'opengl32.dll']:
        f = os.path.normcase(os.path.normpath(os.path.join(dir, file)))
        if not tried.has_key(f):
            tried[f] = print_mtime(f)

scene.title = "Renderer test"
scene.height = 2
scene.visible = 1
print scene.info()
scene.visible = 0