fixed sphinx doc generator

- arguments, return values indentation means they get correctly interpreted by sphinx
- functions with no return values were displaying return as ()
- return values were getting the '(optional)' added in some cases.

Example:
http://www.blender.org/documentation/250PythonDoc/bpy.ops.object.html
This commit is contained in:
Campbell Barton
2010-01-17 20:59:35 +00:00
parent f50ec12d9f
commit 381e926600
2 changed files with 12 additions and 14 deletions

View File

@@ -201,7 +201,7 @@ class InfoPropertyRNA:
return "%s=%s" % (self.identifier, default)
return self.identifier
def get_type_description(self, as_arg=False, class_fmt="%s"):
def get_type_description(self, as_ret=False, as_arg=False, class_fmt="%s"):
type_str = ""
if self.fixed_type is None:
type_str += self.type
@@ -223,7 +223,9 @@ class InfoPropertyRNA:
type_str += collection_str + (class_fmt % self.fixed_type.identifier)
if as_arg:
if as_ret:
pass
elif as_arg:
if not self.is_required:
type_str += ", (optional)"
else: # readonly is only useful for selfs, not args