[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender[28018] branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py: Added an entry for thedocumentation of the Freestyle Python API.
Tamito KAJIYAMA
rd6t-kjym at asahi-net.or.jp
Mon Apr 5 23:50:20 CEST 2010
Roger,
Here is the context of the fix I made:
def py_c_func2sphinx(ident, fw, identifier, py_func, is_class=True):
'''
c defined function to sphinx.
'''
# dump the docstring, assume its formatted correctly
if py_func.__doc__:
write_indented_lines(ident, fw, py_func.__doc__, False)
fw("\n")
else:
fw(ident + ".. function:: %s()\n\n" % identifier)
fw(ident + " Undocumented function.\n\n" % identifier)
When a C extention function has a docstring, it goes into the API
documentation as you expected. Note that the string literal in the
last line above does not contain a %s formatting specifier, which
causes sphinx_doc_gen.py to fail at runtime. My fix was just
intended to correct this issue and nothing more than that.
Regards,
--
KAJIYAMA, Tamito <rd6t-kjym at asahi-net.or.jp>
----- Original Message -----
From: "Roger Wickes" <rogerwickes at yahoo.com>
To: "bf-blender developers" <bf-committers at blender.org>
Sent: Monday, April 05, 2010 10:27 PM
Subject: [Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender[28018]
branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py: Added an entry for thedocumentation of the Freestyle Python
API.
> wouldnt it be better, since some functions do have docstrings and it is valuable debugging info to get it in those cases, to
> instead insert a line above like if docstring==None then docstring='<C function without docstring>' or if the type error is caused
> by docstring being a numeric then converting it, rather than removing the variable?
>
> --Roger
>
>
> Check out my website at www.rogerwickes.com for a good deal on my book and
> training course, as well as information about my latest activities. Use coupon
> Papasmurf for $15 off!
>
>
>
>
> ________________________________
> From: Tamito KAJIYAMA <rd6t-kjym at asahi-net.or.jp>
> To: bf-committers at blender.org
> Sent: Mon, April 5, 2010 5:09:45 PM
> Subject: Re: [Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28018] branches/soc-2008-mxcurioni/source
> /blender/python/doc/sphinx_doc_gen.py: Added an entry for the documentation of the Freestyle Python API.
>
> Hi,
>
> I just committed a fix for a minor bug in sphinx_doc_gen.py within
> the Freestyle branch. This fix also applies to the trunk.
>
> Hope this helps,
>
> --
> KAJIYAMA, Tamito <rd6t-kjym at asahi-net.or.jp>
>
>
> ----- Original Message -----
> From: "Tamito Kajiyama" <rd6t-kjym at asahi-net.or.jp>
> To: <bf-blender-cvs at blender.org>
> Sent: Monday, April 05, 2010 10:06 PM
> Subject: [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28018] branches/soc-2008-mxcurioni/source
> /blender/python/doc/sphinx_doc_gen.py: Added an entry for the documentation of the Freestyle Python API.
>
>
>> Revision: 28018
>> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28018
>> Author: kjym3
>> Date: 2010-04-05 23:06:32 +0200 (Mon, 05 Apr 2010)
>>
>> Log Message:
>> -----------
>> Added an entry for the documentation of the Freestyle Python API.
>> Also fixed a minor bug in sphinx_doc_gen.py that raised a TypeError
>> when a C extension function does not have a docstring.
>>
>> 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-05 18:34:18 UTC (rev 28017)
>> +++ branches/soc-2008-mxcurioni/source/blender/python/doc/sphinx_doc_gen.py 2010-04-05 21:06:32 UTC (rev 28018)
>> @@ -129,7 +129,7 @@
>> fw("\n")
>> else:
>> fw(ident + ".. function:: %s()\n\n" % identifier)
>> - fw(ident + " Undocumented function.\n\n" % identifier)
>> + fw(ident + " Undocumented function.\n\n")
More information about the Bf-committers
mailing list