Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-31 07:15:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-31 07:15:37 +0400
commitf4293067c1420827ddfa62e62430870c6b790a8a (patch)
tree6ad74d1ea760e4450dd27236a0f7ed3987d4283b /doc
parent670f58023c478995ed055e194482ab288db436a7 (diff)
py api: sphinx doc corrections, pep8 cleanup and style edits, also added __all__ to some modules which were missing it.
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/rst/bge.constraints.rst2
-rw-r--r--doc/python_api/rst/bge.events.rst2
-rw-r--r--doc/python_api/rst/bge.logic.rst3
-rw-r--r--doc/python_api/rst/bge.render.rst12
-rw-r--r--doc/python_api/rst/bge.texture.rst2
-rw-r--r--doc/python_api/rst/bge.types.rst2
-rw-r--r--doc/python_api/rst/bgl.rst7
-rw-r--r--doc/python_api/sphinx_doc_gen.py19
8 files changed, 33 insertions, 16 deletions
diff --git a/doc/python_api/rst/bge.constraints.rst b/doc/python_api/rst/bge.constraints.rst
index 2e7bc2daed4..12ce8617457 100644
--- a/doc/python_api/rst/bge.constraints.rst
+++ b/doc/python_api/rst/bge.constraints.rst
@@ -1,6 +1,6 @@
Physics Constraints (bge.constraints)
-==================================
+=====================================
.. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])
diff --git a/doc/python_api/rst/bge.events.rst b/doc/python_api/rst/bge.events.rst
index f6f465d0cd3..074e928f0d8 100644
--- a/doc/python_api/rst/bge.events.rst
+++ b/doc/python_api/rst/bge.events.rst
@@ -1,6 +1,6 @@
Game Keys (bge.events)
-=============================
+======================
*****
Intro
diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst
index 53a2362b8d9..128f87f76bd 100644
--- a/doc/python_api/rst/bge.logic.rst
+++ b/doc/python_api/rst/bge.logic.rst
@@ -1,6 +1,7 @@
Game Logic (bge.logic)
-============================
+======================
+
*****
Intro
*****
diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst
index f56b3d619ad..10514049a8a 100644
--- a/doc/python_api/rst/bge.render.rst
+++ b/doc/python_api/rst/bge.render.rst
@@ -1,6 +1,6 @@
Rasterizer (bge.render)
-=============================
+=======================
*****
Intro
@@ -16,8 +16,8 @@ Intro
import bge.render
import bge.logic
- # SCALE sets the speed of motion
- SCALE=[1, 0.5]
+ # scale sets the speed of motion
+ scale = 1.0, 0.5
co = bge.logic.getCurrentController()
obj = co.getOwner()
@@ -27,8 +27,8 @@ Intro
# Transform the mouse coordinates to see how far the mouse has moved.
def mousePos():
- x = (bge.render.getWindowWidth()/2 - mouse.getXPosition())*SCALE[0]
- y = (bge.render.getWindowHeight()/2 - mouse.getYPosition())*SCALE[1]
+ x = (bge.render.getWindowWidth() / 2 - mouse.getXPosition()) * scale[0]
+ y = (bge.render.getWindowHeight() / 2 - mouse.getYPosition()) * scale[1]
return (x, y)
pos = mousePos()
@@ -43,7 +43,7 @@ Intro
bge.logic.addActiveActuator(wmotion, True)
# Centre the mouse
- bge.render.setMousePosition(bge.render.getWindowWidth()/2, bge.render.getWindowHeight()/2)
+ bge.render.setMousePosition(bge.render.getWindowWidth() / 2, bge.render.getWindowHeight() / 2)
*********
Constants
diff --git a/doc/python_api/rst/bge.texture.rst b/doc/python_api/rst/bge.texture.rst
index 53de315fa75..f3e9f98dded 100644
--- a/doc/python_api/rst/bge.texture.rst
+++ b/doc/python_api/rst/bge.texture.rst
@@ -1,6 +1,6 @@
Video Texture (bge.texture)
-==============================
+===========================
*****
Intro
diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst
index 1e9e1cca58e..36ef9154e17 100644
--- a/doc/python_api/rst/bge.types.rst
+++ b/doc/python_api/rst/bge.types.rst
@@ -1,6 +1,6 @@
Game Types (bge.types)
-=============================
+======================
.. module:: bge.types
diff --git a/doc/python_api/rst/bgl.rst b/doc/python_api/rst/bgl.rst
index ef15d31f43e..236bfafb295 100644
--- a/doc/python_api/rst/bgl.rst
+++ b/doc/python_api/rst/bgl.rst
@@ -1,6 +1,6 @@
OpenGL Wrapper (bgl)
-===========================
+====================
.. module:: bgl
@@ -71,8 +71,8 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
.. seealso:: `OpenGL Docs <http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html>`_
:type mode: Enumerated constant
- :arg mode: Specifies the primitive that will be create from vertices between glBegin and
- glEnd.
+ :arg mode: Specifies the primitive that will be create from vertices between
+ glBegin and glEnd.
.. function:: glBindTexture(target, texture):
@@ -1886,4 +1886,3 @@ class Buffer:
the Buffer. If a template is not passed in all fields will be initialized to 0.
:rtype: Buffer object
:return: The newly created buffer as a PyObject.
-
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 6b514cf9eb1..f8561c719bc 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -416,6 +416,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
del key, descr
classes = []
+ submodules = []
for attribute in module_dir:
if not attribute.startswith("_"):
@@ -437,6 +438,8 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type == type:
classes.append((attribute, value))
+ elif issubclass(value_type, types.ModuleType):
+ submodules.append((attribute, value))
elif value_type in (bool, int, float, str, tuple):
# constant, not much fun we can do here except to list it.
# TODO, figure out some way to document these!
@@ -444,12 +447,26 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
write_indented_lines(" ", fw, "constant value %s" % repr(value), False)
fw("\n")
else:
- print("\tnot documenting %s.%s" % (module_name, attribute))
+ print("\tnot documenting %s.%s of %r type" % (module_name, attribute, value_type.__name__))
continue
attribute_set.add(attribute)
# TODO, more types...
+ # TODO, bpy_extras does this already, mathutils not.
+ """
+ if submodules:
+ fw("\n"
+ "**********\n"
+ "Submodules\n"
+ "**********\n"
+ "\n"
+ )
+ for attribute, submod in submodules:
+ fw("* :mod:`%s.%s`\n" % (module_name, attribute))
+ fw("\n")
+ """
+
# write collected classes now
for (type_name, value) in classes:
# May need to be its own function