Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-05-03 19:52:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-05-03 19:52:15 +0400
commit914d5e5f62acf90e2a3a4e9c65a622a04b574293 (patch)
treeaf236b5aa15563db94d8af9b3adb9a997d9916b7 /release/scripts/modules/rna_info.py
parent88c3b68207c0d3961a36b0a78563221a9f351c70 (diff)
sphinx doc generation
- include default values as well as min/max. - partial rebuilds, so we dont have to build all docs each time, only the changed files.
Diffstat (limited to 'release/scripts/modules/rna_info.py')
-rw-r--r--release/scripts/modules/rna_info.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index d0a9de329c1..7a1f5d1bc4a 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -245,11 +245,18 @@ class InfoPropertyRNA:
type_str += self.type
if self.array_length:
type_str += " array of %d items" % (self.array_length)
-
+
if self.type in ("float", "int"):
type_str += " in [%s, %s]" % (range_str(self.min), range_str(self.max))
elif self.type == "enum":
type_str += " in [%s]" % ', '.join([("'%s'" % s) for s in self.enum_items])
+
+ if not (as_arg or as_ret):
+ # write default property, ignore function args for this
+ default_str = self.get_default_string()
+ if default_str:
+ type_str += ", default %s" % default_str
+
else:
if self.type == "collection":
if self.collection_type:
@@ -261,17 +268,22 @@ class InfoPropertyRNA:
type_str += collection_str + (class_fmt % self.fixed_type.identifier)
+ # setup qualifiers for this value.
+ type_info = []
if as_ret:
pass
elif as_arg:
if not self.is_required:
- type_str += ", (optional)"
+ type_info.append("optional")
else: # readonly is only useful for selfs, not args
if self.is_readonly:
- type_str += ", (readonly)"
+ type_info.append("readonly")
if self.is_never_none:
- type_str += ", (never None)"
+ type_info.append("never None")
+
+ if type_info:
+ type_str += (", (%s)" % ", ".join(type_info))
return type_str