Cleanup: pep8

This commit is contained in:
2016-07-30 18:39:22 +10:00
parent de103497c4
commit e20d306ffa
2 changed files with 206 additions and 162 deletions

View File

@@ -48,7 +48,8 @@ python doc/python_api/sphinx_changelog_gen.py -- \
''' '''
{"module.name": {"module.name":
{"parent.class": {"parent.class":
{"basic_type", "member_name": ("Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types)}, ... {"basic_type", "member_name":
("Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types)}, ...
}, ... }, ...
} }
''' '''
@@ -99,34 +100,34 @@ def api_dump():
prop_range = None prop_range = None
dump_class[prop_id] = ( dump_class[prop_id] = (
"prop_rna", # basic_type "prop_rna", # basic_type
prop.name, # name prop.name, # name
prop_type, # type prop_type, # type
prop_range, # range prop_range, # range
prop_length, # length prop_length, # length
prop.default, # default prop.default, # default
prop.description, # descr prop.description, # descr
Ellipsis, # f_args Ellipsis, # f_args
Ellipsis, # f_arg_types Ellipsis, # f_arg_types
Ellipsis, # f_ret_types Ellipsis, # f_ret_types
) )
del props del props
# python props, tricky since we dont know much about them. # python props, tricky since we dont know much about them.
for prop_id, attr in struct_info.get_py_properties(): for prop_id, attr in struct_info.get_py_properties():
dump_class[prop_id] = ( dump_class[prop_id] = (
"prop_py", # basic_type "prop_py", # basic_type
Ellipsis, # name Ellipsis, # name
Ellipsis, # type Ellipsis, # type
Ellipsis, # range Ellipsis, # range
Ellipsis, # length Ellipsis, # length
Ellipsis, # default Ellipsis, # default
attr.__doc__, # descr attr.__doc__, # descr
Ellipsis, # f_args Ellipsis, # f_args
Ellipsis, # f_arg_types Ellipsis, # f_arg_types
Ellipsis, # f_ret_types Ellipsis, # f_ret_types
) )
# kludge func -> props # kludge func -> props
funcs = [(func.identifier, func) for func in struct_info.functions] funcs = [(func.identifier, func) for func in struct_info.functions]
@@ -137,17 +138,17 @@ def api_dump():
func_args_type = tuple([prop.type for prop in func.args]) func_args_type = tuple([prop.type for prop in func.args])
dump_class[func_id] = ( dump_class[func_id] = (
"func_rna", # basic_type "func_rna", # basic_type
Ellipsis, # name Ellipsis, # name
Ellipsis, # type Ellipsis, # type
Ellipsis, # range Ellipsis, # range
Ellipsis, # length Ellipsis, # length
Ellipsis, # default Ellipsis, # default
func.description, # descr func.description, # descr
func_args_ids, # f_args func_args_ids, # f_args
func_args_type, # f_arg_types func_args_type, # f_arg_types
func_ret_types, # f_ret_types func_ret_types, # f_ret_types
) )
del funcs del funcs
# kludge func -> props # kludge func -> props
@@ -158,17 +159,17 @@ def api_dump():
func_args_ids = tuple(inspect.getargspec(attr).args) func_args_ids = tuple(inspect.getargspec(attr).args)
dump_class[func_id] = ( dump_class[func_id] = (
"func_py", # basic_type "func_py", # basic_type
Ellipsis, # name Ellipsis, # name
Ellipsis, # type Ellipsis, # type
Ellipsis, # range Ellipsis, # range
Ellipsis, # length Ellipsis, # length
Ellipsis, # default Ellipsis, # default
attr.__doc__, # descr attr.__doc__, # descr
func_args_ids, # f_args func_args_ids, # f_args
Ellipsis, # f_arg_types Ellipsis, # f_arg_types
Ellipsis, # f_ret_types Ellipsis, # f_ret_types
) )
del funcs del funcs
import pprint import pprint
@@ -336,15 +337,19 @@ def main():
parser = argparse.ArgumentParser(description=usage_text, epilog=epilog) parser = argparse.ArgumentParser(description=usage_text, epilog=epilog)
parser.add_argument("--dump", dest="dump", action='store_true', parser.add_argument(
help="When set the api will be dumped into blender_version.py") "--dump", dest="dump", action='store_true',
help="When set the api will be dumped into blender_version.py")
parser.add_argument("--api_from", dest="api_from", metavar='FILE', parser.add_argument(
help="File to compare from (previous version)") "--api_from", dest="api_from", metavar='FILE',
parser.add_argument("--api_to", dest="api_to", metavar='FILE', help="File to compare from (previous version)")
help="File to compare from (current)") parser.add_argument(
parser.add_argument("--api_out", dest="api_out", metavar='FILE', "--api_to", dest="api_to", metavar='FILE',
help="Output sphinx changelog") help="File to compare from (current)")
parser.add_argument(
"--api_out", dest="api_out", metavar='FILE',
help="Output sphinx changelog")
args = parser.parse_args(argv) # In this example we wont use the args args = parser.parse_args(argv) # In this example we wont use the args

View File

@@ -181,15 +181,13 @@ def handle_args():
dest="log", dest="log",
default=False, default=False,
action='store_true', action='store_true',
help=( help="Log the output of the api dump and sphinx|latex "
"Log the output of the api dump and sphinx|latex " "warnings and errors (default=False).\n"
"warnings and errors (default=False).\n" "If given, save logs in:\n"
"If given, save logs in:\n" "* OUTPUT_DIR/.bpy.log\n"
"* OUTPUT_DIR/.bpy.log\n" "* OUTPUT_DIR/.sphinx-build.log\n"
"* OUTPUT_DIR/.sphinx-build.log\n" "* OUTPUT_DIR/.sphinx-build_pdf.log\n"
"* OUTPUT_DIR/.sphinx-build_pdf.log\n" "* OUTPUT_DIR/.latex_make.log",
"* OUTPUT_DIR/.latex_make.log",
),
required=False) required=False)
# parse only the args passed after '--' # parse only the args passed after '--'
@@ -228,8 +226,8 @@ if not ARGS.partial:
else: else:
# can manually edit this too: # can manually edit this too:
#FILTER_BPY_OPS = ("import.scene", ) # allow # FILTER_BPY_OPS = ("import.scene", ) # allow
#FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow # FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow
EXCLUDE_INFO_DOCS = True EXCLUDE_INFO_DOCS = True
EXCLUDE_MODULES = [ EXCLUDE_MODULES = [
"aud", "aud",
@@ -275,7 +273,7 @@ else:
"freestyle.shaders", "freestyle.shaders",
"freestyle.types", "freestyle.types",
"freestyle.utils", "freestyle.utils",
] ]
# ------ # ------
# Filter # Filter
@@ -301,7 +299,9 @@ else:
del m del m
del fnmatch del fnmatch
BPY_LOGGER.debug("Partial Doc Build, Skipping: %s\n" % "\n ".join(sorted(EXCLUDE_MODULES))) BPY_LOGGER.debug(
"Partial Doc Build, Skipping: %s\n" %
"\n ".join(sorted(EXCLUDE_MODULES)))
# #
# done filtering # done filtering
@@ -340,7 +340,7 @@ EXTRA_SOURCE_FILES = (
"../examples/bge.texture.py", "../examples/bge.texture.py",
"../examples/bmesh.ops.1.py", "../examples/bmesh.ops.1.py",
"../examples/bpy.app.translations.py", "../examples/bpy.app.translations.py",
) )
# examples # examples
@@ -357,52 +357,59 @@ RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
# extra info, not api reference docs # extra info, not api reference docs
# stored in ./rst/info_* # stored in ./rst/info_*
INFO_DOCS = ( INFO_DOCS = (
("info_quickstart.rst", "Blender/Python Quickstart: new to blender/scripting and want to get your feet wet?"), ("info_quickstart.rst",
("info_overview.rst", "Blender/Python API Overview: a more complete explanation of python integration"), "Blender/Python Quickstart: new to blender/scripting and want to get your feet wet?"),
("info_tutorial_addon.rst", "Blender/Python Addon Tutorial: a step by step guide on how to write an addon from scratch"), ("info_overview.rst",
("info_api_reference.rst", "Blender/Python API Reference Usage: examples of how to use the API reference docs"), "Blender/Python API Overview: a more complete explanation of python integration"),
("info_best_practice.rst", "Best Practice: Conventions to follow for writing good scripts"), ("info_tutorial_addon.rst",
("info_tips_and_tricks.rst", "Tips and Tricks: Hints to help you while writing scripts for blender"), "Blender/Python Addon Tutorial: a step by step guide on how to write an addon from scratch"),
("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"), ("info_api_reference.rst",
) "Blender/Python API Reference Usage: examples of how to use the API reference docs"),
("info_best_practice.rst",
"Best Practice: Conventions to follow for writing good scripts"),
("info_tips_and_tricks.rst",
"Tips and Tricks: Hints to help you while writing scripts for blender"),
("info_gotcha.rst",
"Gotcha's: some of the problems you may come up against when writing scripts"),
)
# only support for properties atm. # only support for properties atm.
RNA_BLACKLIST = { RNA_BLACKLIST = {
# XXX messes up PDF!, really a bug but for now just workaround. # XXX messes up PDF!, really a bug but for now just workaround.
"UserPreferencesSystem": {"language", } "UserPreferencesSystem": {"language", }
} }
MODULE_GROUPING = { MODULE_GROUPING = {
"bmesh.types": ( "bmesh.types": (
("Base Mesh Type", '-'), ("Base Mesh Type", '-'),
"BMesh", "BMesh",
("Mesh Elements", '-'), ("Mesh Elements", '-'),
"BMVert", "BMVert",
"BMEdge", "BMEdge",
"BMFace", "BMFace",
"BMLoop", "BMLoop",
("Sequence Accessors", '-'), ("Sequence Accessors", '-'),
"BMElemSeq", "BMElemSeq",
"BMVertSeq", "BMVertSeq",
"BMEdgeSeq", "BMEdgeSeq",
"BMFaceSeq", "BMFaceSeq",
"BMLoopSeq", "BMLoopSeq",
"BMIter", "BMIter",
("Selection History", '-'), ("Selection History", '-'),
"BMEditSelSeq", "BMEditSelSeq",
"BMEditSelIter", "BMEditSelIter",
("Custom-Data Layer Access", '-'), ("Custom-Data Layer Access", '-'),
"BMLayerAccessVert", "BMLayerAccessVert",
"BMLayerAccessEdge", "BMLayerAccessEdge",
"BMLayerAccessFace", "BMLayerAccessFace",
"BMLayerAccessLoop", "BMLayerAccessLoop",
"BMLayerCollection", "BMLayerCollection",
"BMLayerItem", "BMLayerItem",
("Custom-Data Layer Types", '-'), ("Custom-Data Layer Types", '-'),
"BMLoopUV", "BMLoopUV",
"BMDeformVert" "BMDeformVert"
) )
} }
# --------------------configure compile time options---------------------------- # --------------------configure compile time options----------------------------
@@ -478,10 +485,10 @@ MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real) GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None)) StaticMethodType = type(staticmethod(lambda: None))
from types import ( from types import (
MemberDescriptorType, MemberDescriptorType,
MethodType, MethodType,
FunctionType, FunctionType,
) )
_BPY_STRUCT_FAKE = "bpy_struct" _BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection" _BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
@@ -501,7 +508,7 @@ escape_rst.trans = str.maketrans({
"|": "\\|", "|": "\\|",
"*": "\\*", "*": "\\*",
"\\": "\\\\", "\\": "\\\\",
}) })
def is_struct_seq(value): def is_struct_seq(value):
@@ -846,7 +853,8 @@ def pymodule2sphinx(basepath, module_name, module, title):
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect. # naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
# type_name is only used for examples and messages # type_name is only used for examples and messages
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1] # "<class 'bpy.app.handlers'>" --> bpy.app.handlers # "<class 'bpy.app.handlers'>" --> bpy.app.handlers
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1]
if type(descr) == types.GetSetDescriptorType: if type(descr) == types.GetSetDescriptorType:
py_descr2sphinx("", fw, descr, module_name, type_name, key) py_descr2sphinx("", fw, descr, module_name, type_name, key)
attribute_set.add(key) attribute_set.add(key)
@@ -907,7 +915,8 @@ def pymodule2sphinx(basepath, module_name, module, title):
for attribute, value, value_type in module_dir_value_type: for attribute, value, value_type in module_dir_value_type:
if value_type == FunctionType: if value_type == FunctionType:
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False) pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof # both the same at the moment but to be future proof
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}:
# note: can't get args from these, so dump the string as is # note: can't get args from these, so dump the string as is
# this means any module used like this must have fully formatted docstrings. # this means any module used like this must have fully formatted docstrings.
py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False) py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
@@ -1086,7 +1095,8 @@ def pycontext2sphinx(basepath):
fw("\n") fw("\n")
fw("The context members available depend on the area of blender which is currently being accessed.\n") fw("The context members available depend on the area of blender which is currently being accessed.\n")
fw("\n") fw("\n")
fw("Note that all context values are readonly, but may be modified through the data api or by running operators\n\n") fw("Note that all context values are readonly,\n")
fw("but may be modified through the data api or by running operators\n\n")
def write_contex_cls(): def write_contex_cls():
@@ -1109,7 +1119,8 @@ def pycontext2sphinx(basepath):
if prop.identifier in struct_blacklist: if prop.identifier in struct_blacklist:
continue continue
type_descr = prop.get_type_description(class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID) type_descr = prop.get_type_description(
class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID)
fw(".. data:: %s\n\n" % prop.identifier) fw(".. data:: %s\n\n" % prop.identifier)
if prop.description: if prop.description:
fw(" %s\n\n" % prop.description) fw(" %s\n\n" % prop.description)
@@ -1165,7 +1176,9 @@ def pycontext2sphinx(basepath):
# for member in sorted(unique): # for member in sorted(unique):
# print(' "%s": ("", False),' % member) # print(' "%s": ("", False),' % member)
if len(context_type_map) > len(unique): if len(context_type_map) > len(unique):
raise Exception("Some types are not used: %s" % str([member for member in context_type_map if member not in unique])) raise Exception(
"Some types are not used: %s" %
str([member for member in context_type_map if member not in unique]))
else: else:
pass # will have raised an error above pass # will have raised an error above
@@ -1244,11 +1257,11 @@ def pyrna2sphinx(basepath):
fw(ident + ":%s%s: %s\n" % (id_type, identifier, type_descr)) fw(ident + ":%s%s: %s\n" % (id_type, identifier, type_descr))
def write_struct(struct): def write_struct(struct):
#if not struct.identifier.startswith("Sc") and not struct.identifier.startswith("I"): # if not struct.identifier.startswith("Sc") and not struct.identifier.startswith("I"):
# return # return
#if not struct.identifier == "Object": # if not struct.identifier == "Object":
# return # return
filepath = os.path.join(basepath, "bpy.types.%s.rst" % struct.identifier) filepath = os.path.join(basepath, "bpy.types.%s.rst" % struct.identifier)
file = open(filepath, "w", encoding="utf-8") file = open(filepath, "w", encoding="utf-8")
@@ -1289,7 +1302,11 @@ def pyrna2sphinx(basepath):
fw(", ".join((":class:`%s`" % base_id) for base_id in base_ids)) fw(", ".join((":class:`%s`" % base_id) for base_id in base_ids))
fw("\n\n") fw("\n\n")
subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)] subclass_ids = [
s.identifier for s in structs.values()
if s.base is struct
if not rna_info.rna_id_ignore(s.identifier)
]
subclass_ids.sort() subclass_ids.sort()
if subclass_ids: if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n") fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n")
@@ -1350,7 +1367,8 @@ def pyrna2sphinx(basepath):
for func in struct.functions: for func in struct.functions:
args_str = ", ".join(prop.get_arg_default(force=False) for prop in func.args) args_str = ", ".join(prop.get_arg_default(force=False) for prop in func.args)
fw(" .. %s:: %s(%s)\n\n" % ("classmethod" if func.is_classmethod else "method", func.identifier, args_str)) fw(" .. %s:: %s(%s)\n\n" %
("classmethod" if func.is_classmethod else "method", func.identifier, args_str))
fw(" %s\n\n" % func.description) fw(" %s\n\n" % func.description)
for prop in func.args: for prop in func.args:
@@ -1361,8 +1379,10 @@ def pyrna2sphinx(basepath):
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 think we even use this but still!!! # TODO, pyrna_enum2sphinx for multiple return values... actually dont
type_descr = prop.get_type_description(as_ret=True, class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID) # think we even use this but still!!!
type_descr = prop.get_type_description(
as_ret=True, class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID)
descr = prop.description descr = prop.description
if not descr: if not descr:
descr = prop.name descr = prop.name
@@ -1398,7 +1418,10 @@ def pyrna2sphinx(basepath):
del lines[:] del lines[:]
if _BPY_STRUCT_FAKE: if _BPY_STRUCT_FAKE:
descr_items = [(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items()) if not key.startswith("__")] descr_items = [
(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items())
if not key.startswith("__")
]
if _BPY_STRUCT_FAKE: if _BPY_STRUCT_FAKE:
for key, descr in descr_items: for key, descr in descr_items:
@@ -1494,19 +1517,28 @@ def pyrna2sphinx(basepath):
fw("\n") fw("\n")
if use_subclasses: if use_subclasses:
subclass_ids = [s.identifier for s in structs.values() if s.base is None if not rna_info.rna_id_ignore(s.identifier)] subclass_ids = [
s.identifier for s in structs.values()
if s.base is None
if not rna_info.rna_id_ignore(s.identifier)
]
if subclass_ids: if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in sorted(subclass_ids)) + "\n\n") fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in sorted(subclass_ids)) + "\n\n")
fw(".. class:: %s\n\n" % class_name) fw(".. class:: %s\n\n" % class_name)
fw(" %s\n\n" % descr_str) fw(" %s\n\n" % descr_str)
fw(" .. note::\n\n") fw(" .. note::\n\n")
fw(" Note that bpy.types.%s is not actually available from within blender, it only exists for the purpose of documentation.\n\n" % class_name) fw(" Note that bpy.types.%s is not actually available from within Blender,\n"
" it only exists for the purpose of documentation.\n\n" % class_name)
descr_items = [(key, descr) for key, descr in sorted(class_value.__dict__.items()) if not key.startswith("__")] descr_items = [
(key, descr) for key, descr in sorted(class_value.__dict__.items())
if not key.startswith("__")
]
for key, descr in descr_items: for key, descr in descr_items:
if type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet # GetSetDescriptorType, GetSetDescriptorType's are not documented yet
if type(descr) == MethodDescriptorType:
py_descr2sphinx(" ", fw, descr, "bpy.types", class_name, key) py_descr2sphinx(" ", fw, descr, "bpy.types", class_name, key)
for key, descr in descr_items: for key, descr in descr_items:
@@ -1517,11 +1549,15 @@ def pyrna2sphinx(basepath):
# write fake classes # write fake classes
if _BPY_STRUCT_FAKE: if _BPY_STRUCT_FAKE:
class_value = bpy.types.Struct.__bases__[0] class_value = bpy.types.Struct.__bases__[0]
fake_bpy_type(class_value, _BPY_STRUCT_FAKE, "built-in base class for all classes in bpy.types.", use_subclasses=True) fake_bpy_type(
class_value, _BPY_STRUCT_FAKE,
"built-in base class for all classes in bpy.types.", use_subclasses=True)
if _BPY_PROP_COLLECTION_FAKE: if _BPY_PROP_COLLECTION_FAKE:
class_value = bpy.data.objects.__class__ class_value = bpy.data.objects.__class__
fake_bpy_type(class_value, _BPY_PROP_COLLECTION_FAKE, "built-in class used for all collections.", use_subclasses=False) fake_bpy_type(
class_value, _BPY_PROP_COLLECTION_FAKE,
"built-in class used for all collections.", use_subclasses=False)
# operators # operators
def write_ops(): def write_ops():
@@ -1633,11 +1669,13 @@ def write_rst_contents(basepath):
fw(title_string("Blender Documentation Contents", "%", double=True)) fw(title_string("Blender Documentation Contents", "%", double=True))
fw("\n") fw("\n")
fw("Welcome, this document is an API reference for Blender %s, built %s.\n" % (BLENDER_VERSION_DOTS, BLENDER_DATE)) fw("Welcome, this document is an API reference for Blender %s, built %s.\n" %
(BLENDER_VERSION_DOTS, BLENDER_DATE))
fw("\n") fw("\n")
# fw("`A PDF version of this document is also available <%s>`_\n" % BLENDER_PDF_FILENAME) # fw("`A PDF version of this document is also available <%s>`_\n" % BLENDER_PDF_FILENAME)
fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" % BLENDER_ZIP_FILENAME) fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" %
BLENDER_ZIP_FILENAME)
fw("\n") fw("\n")
@@ -1670,7 +1708,7 @@ def write_rst_contents(basepath):
# C modules # C modules
"bpy.props", "bpy.props",
) )
for mod in app_modules: for mod in app_modules:
if mod not in EXCLUDE_MODULES: if mod not in EXCLUDE_MODULES:
@@ -1693,7 +1731,7 @@ def write_rst_contents(basepath):
"aud", "bpy_extras", "aud", "bpy_extras",
# bmesh, submodules are in own page # bmesh, submodules are in own page
"bmesh", "bmesh",
) )
for mod in standalone_modules: for mod in standalone_modules:
if mod not in EXCLUDE_MODULES: if mod not in EXCLUDE_MODULES:
@@ -1731,7 +1769,8 @@ def write_rst_contents(basepath):
fw(" * mesh creation and editing functions\n") fw(" * mesh creation and editing functions\n")
fw(" \n") fw(" \n")
fw(" These parts of the API are relatively stable and are unlikely to change significantly\n") fw(" These parts of the API are relatively stable and are unlikely to change significantly\n")
fw(" * data API, access to attributes of blender data such as mesh verts, material color, timeline frames and scene objects\n") fw(" * data API, access to attributes of blender data such as mesh verts, material color,\n")
fw(" timeline frames and scene objects\n")
fw(" * user interface functions for defining buttons, creation of menus, headers, panels\n") fw(" * user interface functions for defining buttons, creation of menus, headers, panels\n")
fw(" * render engine integration\n") fw(" * render engine integration\n")
fw(" * modules: bgl, mathutils & game engine.\n") fw(" * modules: bgl, mathutils & game engine.\n")
@@ -1823,36 +1862,36 @@ def write_rst_importable_modules(basepath):
''' '''
importable_modules = { importable_modules = {
# python_modules # python_modules
"bpy.path" : "Path Utilities", "bpy.path": "Path Utilities",
"bpy.utils" : "Utilities", "bpy.utils": "Utilities",
"bpy_extras" : "Extra Utilities", "bpy_extras": "Extra Utilities",
# C_modules # C_modules
"aud" : "Audio System", "aud": "Audio System",
"blf" : "Font Drawing", "blf": "Font Drawing",
"gpu.offscreen" : "GPU Off-Screen Buffer", "gpu.offscreen": "GPU Off-Screen Buffer",
"bmesh" : "BMesh Module", "bmesh": "BMesh Module",
"bmesh.types" : "BMesh Types", "bmesh.types": "BMesh Types",
"bmesh.utils" : "BMesh Utilities", "bmesh.utils": "BMesh Utilities",
"bmesh.geometry" : "BMesh Geometry Utilities", "bmesh.geometry": "BMesh Geometry Utilities",
"bpy.app" : "Application Data", "bpy.app": "Application Data",
"bpy.app.handlers" : "Application Handlers", "bpy.app.handlers": "Application Handlers",
"bpy.app.translations" : "Application Translations", "bpy.app.translations": "Application Translations",
"bpy.props" : "Property Definitions", "bpy.props": "Property Definitions",
"mathutils" : "Math Types & Utilities", "mathutils": "Math Types & Utilities",
"mathutils.geometry" : "Geometry Utilities", "mathutils.geometry": "Geometry Utilities",
"mathutils.bvhtree" : "BVHTree Utilities", "mathutils.bvhtree": "BVHTree Utilities",
"mathutils.kdtree" : "KDTree Utilities", "mathutils.kdtree": "KDTree Utilities",
"mathutils.interpolate": "Interpolation Utilities", "mathutils.interpolate": "Interpolation Utilities",
"mathutils.noise" : "Noise Utilities", "mathutils.noise": "Noise Utilities",
"freestyle" : "Freestyle Module", "freestyle": "Freestyle Module",
"freestyle.types" : "Freestyle Types", "freestyle.types": "Freestyle Types",
"freestyle.predicates" : "Freestyle Predicates", "freestyle.predicates": "Freestyle Predicates",
"freestyle.functions" : "Freestyle Functions", "freestyle.functions": "Freestyle Functions",
"freestyle.chainingiterators" : "Freestyle Chaining Iterators", "freestyle.chainingiterators": "Freestyle Chaining Iterators",
"freestyle.shaders" : "Freestyle Shaders", "freestyle.shaders": "Freestyle Shaders",
"freestyle.utils" : "Freestyle Utilities", "freestyle.utils": "Freestyle Utilities",
} }
for mod_name, mod_descr in importable_modules.items(): for mod_name, mod_descr in importable_modules.items():
if mod_name not in EXCLUDE_MODULES: if mod_name not in EXCLUDE_MODULES:
module = __import__(mod_name, module = __import__(mod_name,