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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-04-10 23:06:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-10 23:06:18 +0400
commit9eb838ce24e28b0f21cff014b8f5f83a4d501b29 (patch)
tree51fc0dbf0482ffa0bd9e29dad48e7608d4dd51a0 /source/blender/python/doc/sphinx_doc_gen.py
parent6e3920e8fa4e2428e7c2bbcf02d0268c5f6aab28 (diff)
bpy.app was writing members more then once.
Diffstat (limited to 'source/blender/python/doc/sphinx_doc_gen.py')
-rw-r--r--source/blender/python/doc/sphinx_doc_gen.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py
index e76300eba01..7a55a488c92 100644
--- a/source/blender/python/doc/sphinx_doc_gen.py
+++ b/source/blender/python/doc/sphinx_doc_gen.py
@@ -167,7 +167,7 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
def pymodule2sphinx(BASEPATH, module_name, module, title):
import types
-
+ attribute_set = set()
filepath = os.path.join(BASEPATH, module_name + ".rst")
file = open(filepath, "w")
@@ -193,13 +193,21 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
if descr.__doc__:
fw(".. data:: %s\n\n" % key)
write_indented_lines(" ", fw, descr.__doc__, False)
+ attribute_set.add(key)
fw("\n")
-
+ del key, descr
classes = []
for attribute in sorted(dir(module)):
if not attribute.startswith("_"):
+
+ if attribute in attribute_set:
+ continue
+
+ if attribute.startswith("n_"): # annoying exception, needed for bpy.app
+ continue
+
value = getattr(module, attribute)
value_type = type(value)
@@ -220,6 +228,9 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
fw("\n")
else:
print("\tnot documenting %s.%s" % (module_name, attribute))
+ continue
+
+ attribute_set.add(attribute)
# TODO, more types...
# write collected classes now