Changeset View
Changeset View
Standalone View
Standalone View
doc/python_api/sphinx_doc_gen.py
| Context not available. | |||||
| # --------------------------------API DUMP-------------------------------------- | # --------------------------------API DUMP-------------------------------------- | ||||
| # lame, python wont give some access | # lame, python won't give some access | ||||
| ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) | ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) | ||||
| MethodDescriptorType = type(dict.get) | MethodDescriptorType = type(dict.get) | ||||
| GetSetDescriptorType = type(int.real) | GetSetDescriptorType = type(int.real) | ||||
| Context not available. | |||||
| if not is_class: | if not is_class: | ||||
| func_type = "function" | func_type = "function" | ||||
| # ther rest are class methods | # the rest are class methods | ||||
| elif arg_str.startswith("(self, ") or arg_str == "(self)": | elif arg_str.startswith("(self, ") or arg_str == "(self)": | ||||
| arg_str = "()" if (arg_str == "(self)") else ("(" + arg_str[7:]) | arg_str = "()" if (arg_str == "(self)") else ("(" + arg_str[7:]) | ||||
| func_type = "method" | func_type = "method" | ||||
| Context not available. | |||||
| fw(".. module:: %s\n\n" % module_name) | fw(".. module:: %s\n\n" % module_name) | ||||
| if module.__doc__: | if module.__doc__: | ||||
| # Note, may contain sphinx syntax, dont mangle! | # Note, may contain sphinx syntax, don't mangle! | ||||
| fw(module.__doc__.strip()) | fw(module.__doc__.strip()) | ||||
| fw("\n\n") | fw("\n\n") | ||||
| Context not available. | |||||
| def write_contex_cls(): | def write_contex_cls(): | ||||
| fw(title_string("Global Context", "-")) | fw(title_string("Global Context", "-")) | ||||
| fw("These properties are avilable in any contexts.\n\n") | fw("These properties are available in any contexts.\n\n") | ||||
| # very silly. could make these global and only access once. | # very silly. could make these global and only access once. | ||||
| # structs, funcs, ops, props = rna_info.BuildRNAInfo() | # structs, funcs, ops, props = rna_info.BuildRNAInfo() | ||||
| Context not available. | |||||
| if prop.description: | if prop.description: | ||||
| fw(" %s\n\n" % prop.description) | fw(" %s\n\n" % prop.description) | ||||
| # special exception, cant use genric code here for enums | # special exception, can't use generic code here for enums | ||||
| if prop.type == "enum": | if prop.type == "enum": | ||||
| enum_text = pyrna_enum2sphinx(prop) | enum_text = pyrna_enum2sphinx(prop) | ||||
| if enum_text: | if enum_text: | ||||
| Context not available. | |||||
| if prop.name or prop.description: | if prop.name or prop.description: | ||||
| fw(ident + " " + ", ".join(val for val in (prop.name, prop.description) if val) + "\n\n") | fw(ident + " " + ", ".join(val for val in (prop.name, prop.description) if val) + "\n\n") | ||||
| # special exception, cant use genric code here for enums | # special exception, can't use generic code here for enums | ||||
| if enum_text: | if enum_text: | ||||
| write_indented_lines(ident + " ", fw, enum_text) | write_indented_lines(ident + " ", fw, enum_text) | ||||
| fw("\n") | fw("\n") | ||||
| Context not available. | |||||
| if prop.description: | if prop.description: | ||||
| fw(" %s\n\n" % prop.description) | fw(" %s\n\n" % prop.description) | ||||
| # special exception, cant use genric code here for enums | # special exception, can't use generic code here for enums | ||||
| if prop.type == "enum": | if prop.type == "enum": | ||||
| enum_text = pyrna_enum2sphinx(prop) | enum_text = pyrna_enum2sphinx(prop) | ||||
| if enum_text: | if enum_text: | ||||
| Context not available. | |||||
| elif func.return_values: # multiple return values | elif func.return_values: # multiple return values | ||||
| fw(" :return (%s):\n" % ", ".join(prop.identifier for prop in func.return_values)) | fw(" :return (%s):\n" % ", ".join(prop.identifier for prop in func.return_values)) | ||||
| for prop in func.return_values: | for prop in func.return_values: | ||||
| # TODO, pyrna_enum2sphinx for multiple return values... actually dont | # TODO, pyrna_enum2sphinx for multiple return values... actually don't | ||||
| # think we even use this but still!!! | # think we even use this but still!!! | ||||
| type_descr = prop.get_type_description( | type_descr = prop.get_type_description( | ||||
| as_ret=True, class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID) | as_ret=True, class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID) | ||||
| Context not available. | |||||