[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28116] trunk/blender/source/blender/ python/doc/sphinx_doc_gen.py: bpy.app was writing members more then once.
Campbell Barton
ideasman42 at gmail.com
Sat Apr 10 21:06:18 CEST 2010
Revision: 28116
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28116
Author: campbellbarton
Date: 2010-04-10 21:06:18 +0200 (Sat, 10 Apr 2010)
Log Message:
-----------
bpy.app was writing members more then once.
Modified Paths:
--------------
trunk/blender/source/blender/python/doc/sphinx_doc_gen.py
Modified: trunk/blender/source/blender/python/doc/sphinx_doc_gen.py
===================================================================
--- trunk/blender/source/blender/python/doc/sphinx_doc_gen.py 2010-04-10 18:35:50 UTC (rev 28115)
+++ trunk/blender/source/blender/python/doc/sphinx_doc_gen.py 2010-04-10 19:06:18 UTC (rev 28116)
@@ -167,7 +167,7 @@
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 @@
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 @@
fw("\n")
else:
print("\tnot documenting %s.%s" % (module_name, attribute))
+ continue
+
+ attribute_set.add(attribute)
# TODO, more types...
# write collected classes now
More information about the Bf-blender-cvs
mailing list