diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-07 19:17:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-07 19:17:42 +0400 |
commit | 115b25673832049b746835357d63d8d2dbee5229 (patch) | |
tree | ca36db0fe4063108ca5820e1d76ae0496fb88f15 /release/test | |
parent | e53bbc7ab7568e315dc3cf06dd5e989300c98786 (diff) |
ran through pep8 checker
Diffstat (limited to 'release/test')
-rw-r--r-- | release/test/rna_info_dump.py | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/release/test/rna_info_dump.py b/release/test/rna_info_dump.py index 8a95f6afa10..1e40c43eac9 100644 --- a/release/test/rna_info_dump.py +++ b/release/test/rna_info_dump.py @@ -23,16 +23,17 @@ import bpy + def api_dump(use_properties=True, use_functions=True): - + def prop_type(prop): if prop.type == "pointer": return prop.fixed_type.identifier else: return prop.type - + def func_to_str(struct_id_str, func_id, func): - + args = [] for prop in func.args: data_str = "%s %s" % (prop_type(prop), prop.identifier) @@ -41,8 +42,7 @@ def api_dump(use_properties=True, use_functions=True): if not prop.is_required: data_str += "=%s" % prop.default_str args.append(data_str) - - + data_str = "%s.%s(%s)" % (struct_id_str, func_id, ", ".join(args)) if func.return_values: return_args = ", ".join([prop_type(arg) for arg in func.return_values]) @@ -51,36 +51,34 @@ def api_dump(use_properties=True, use_functions=True): else: data_str += " --> %s" % return_args return data_str - - + def prop_to_str(struct_id_str, prop_id, prop): - + prop_str = " <-- %s" % prop_type(prop) if prop.array_length: prop_str += "[%d]" % prop.array_length - + data_str = "%s.%s %s" % (struct_id_str, prop_id, prop_str) return data_str - + def struct_full_id(v): - struct_id_str = v.identifier # "".join(sid for sid in struct_id if struct_id) + struct_id_str = v.identifier # "".join(sid for sid in struct_id if struct_id) for base in v.get_bases(): struct_id_str = base.identifier + "|" + struct_id_str return struct_id_str - - + def dump_funcs(): data = [] for struct_id, v in sorted(struct.items()): struct_id_str = struct_full_id(v) funcs = [(func.identifier, func) for func in v.functions] - + for func_id, func in funcs: data.append(func_to_str(struct_id_str, func_id, func)) - + for prop in v.properties: if prop.collection_type: funcs = [(prop.identifier + "." + func.identifier, func) for func in prop.collection_type.functions] @@ -89,7 +87,7 @@ def api_dump(use_properties=True, use_functions=True): data.sort() data.append("# * functions *") return data - + def dump_props(): data = [] for struct_id, v in sorted(struct.items()): @@ -108,7 +106,7 @@ def api_dump(use_properties=True, use_functions=True): data.sort() data.insert(0, "# * properties *") return data - + import rna_info struct = rna_info.BuildRNAInfo()[0] data = [] @@ -126,7 +124,7 @@ def api_dump(use_properties=True, use_functions=True): else: text = bpy.data.texts.new(name="api.py") text.from_string(data) - + print("END") if __name__ == "__main__": |