File: builddocs.py

package info (click to toggle)
pyopengl 3.0.0~b6-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,696 kB
  • ctags: 26,182
  • sloc: python: 34,233; ansic: 70; sh: 26; makefile: 15
file content (47 lines) | stat: -rwxr-xr-x 990 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Script to automatically generate PyTable documentation"""
import pydoc2, inspect
from OpenGL import wrapper
from ctypes import _CFuncPtr

originalIsRoutine = inspect.isroutine
def isroutine( obj ):
	"""Allow wrapper objects to show up as functions in pydoc"""
	return (
		isinstance( obj, (wrapper.Wrapper,_CFuncPtr) ) or 
		originalIsRoutine( obj )
	)
inspect.isroutine = isroutine
originalIsBuiltin = inspect.isbuiltin
def isbuiltin( obj ):
	"""Consider ctypes function pointers to be built-ins"""
	return (
		isinstance( obj, (wrapper.Wrapper,_CFuncPtr) ) or 
		originalIsBuiltin( obj )
	)
inspect.isbuiltin = isbuiltin

if __name__ == "__main__":
	excludes = [
		"Numeric",
		"numpy",
		"_tkinter",
		"Tkinter",
		"math",
		"string",
		"pygame",
	]
	stops = [
	]

	modules = [
		'OpenGL',
		'ctypes',
		'__builtin__',
	]	
	pydoc2.PackageDocumentationGenerator(
		baseModules = modules,
		destinationDirectory = ".",
		exclusions = excludes,
		recursionStops = stops,
	).process ()