Fix for including docstrings of static methods.

This commit is contained in:
Tamito Kajiyama 2010-04-13 00:55:37 +00:00
parent 7a4a3ec626
commit 11fc330f7e

@ -147,6 +147,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
# lame, python wont give some access
MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None))
@ -225,6 +226,12 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
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")