[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28155] branches/soc-2008-mxcurioni/source /blender/python/doc/sphinx_doc_gen.py: Fix for including docstrings of static methods.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Tue Apr 13 02:55:37 CEST 2010


Revision: 28155
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28155
Author:   kjym3
Date:     2010-04-13 02:55:37 +0200 (Tue, 13 Apr 2010)

Log Message:
-----------
Fix for including docstrings of static methods.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py

Modified: branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py	2010-04-12 23:02:14 UTC (rev 28154)
+++ branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py	2010-04-13 00:55:37 UTC (rev 28155)
@@ -147,6 +147,7 @@
     # lame, python wont give some access
     MethodDescriptorType = type(dict.get)
     GetSetDescriptorType = type(int.real)
+    StaticMethodType = type(staticmethod(lambda: None))
     
     
 
@@ -225,6 +226,12 @@
                     write_indented_lines("   ", fw, descr.__doc__, False)
                     write_example_ref("   ", fw, module_name + "." + attribute + "." + key)
                     fw("\n")
+            elif type(descr) == StaticMethodType:
+                descr = getattr(value, key)
+                if descr.__doc__:
+                    write_indented_lines("   ", fw, descr.__doc__, False)
+                    write_example_ref("   ", fw, module_name + "." + attribute + "." + key)
+                    fw("\n")
             
         fw("\n\n")
 





More information about the Bf-blender-cvs mailing list