Doc: minor fixes
- check for class/static methods assumed nonzero args. - subclass references and set-flag items are now sorted. - use 'order' for Py operator mix-ins, so operator settings don't show in random order.
This commit is contained in:
parent
8478c71a7b
commit
8a231185aa
|
@ -633,11 +633,11 @@ def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_cla
|
|||
func_type = "function"
|
||||
|
||||
# ther rest are class methods
|
||||
elif arg_str.startswith("(self, "):
|
||||
arg_str = "(" + arg_str[7:]
|
||||
elif arg_str.startswith("(self, ") or arg_str == "(self)":
|
||||
arg_str = "()" if (arg_str == "(self)") else ("(" + arg_str[7:])
|
||||
func_type = "method"
|
||||
elif arg_str.startswith("(cls, "):
|
||||
arg_str = "(" + arg_str[6:]
|
||||
arg_str = "()" if (arg_str == "(cls)") else ("(" + arg_str[6:])
|
||||
func_type = "classmethod"
|
||||
else:
|
||||
func_type = "staticmethod"
|
||||
|
@ -923,7 +923,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
|||
|
||||
write_example_ref(" ", fw, module_name + "." + type_name)
|
||||
|
||||
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")]
|
||||
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("_")]
|
||||
|
||||
for key, descr in descr_items:
|
||||
if type(descr) == ClassMethodDescriptorType:
|
||||
|
@ -1239,6 +1239,7 @@ def pyrna2sphinx(basepath):
|
|||
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.sort()
|
||||
if subclass_ids:
|
||||
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n")
|
||||
|
||||
|
|
|
@ -61,6 +61,12 @@ class ExportHelper:
|
|||
options={'HIDDEN'},
|
||||
)
|
||||
|
||||
# needed for mix-ins
|
||||
order = [
|
||||
"filepath",
|
||||
"check_existing",
|
||||
]
|
||||
|
||||
# subclasses can override with decorator
|
||||
# True == use ext, False == no ext, None == do nothing.
|
||||
check_extension = True
|
||||
|
@ -109,6 +115,11 @@ class ImportHelper:
|
|||
subtype='FILE_PATH',
|
||||
)
|
||||
|
||||
# needed for mix-ins
|
||||
order = [
|
||||
"filepath",
|
||||
]
|
||||
|
||||
def invoke(self, context, event):
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
@ -154,6 +165,11 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'):
|
|||
update=_update_axis_up,
|
||||
)
|
||||
|
||||
members["order"] = [
|
||||
"axis_forward",
|
||||
"axis_up",
|
||||
]
|
||||
|
||||
return type(name, (object,), members)
|
||||
|
||||
|
||||
|
|
|
@ -268,7 +268,8 @@ class InfoPropertyRNA:
|
|||
self.default_str = "\"%s\"" % self.default
|
||||
elif self.type == "enum":
|
||||
if self.is_enum_flag:
|
||||
self.default_str = "%r" % self.default # repr or set()
|
||||
# self.default_str = "%r" % self.default # repr or set()
|
||||
self.default_str = "{%s}" % repr(list(sorted(self.default)))[1:-1]
|
||||
else:
|
||||
self.default_str = "'%s'" % self.default
|
||||
elif self.array_length:
|
||||
|
|
|
@ -45,6 +45,12 @@ class AddPresetBase:
|
|||
options={'HIDDEN', 'SKIP_SAVE'},
|
||||
)
|
||||
|
||||
# needed for mix-ins
|
||||
order = [
|
||||
"name",
|
||||
"remove_active",
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
def as_filename(name): # could reuse for other presets
|
||||
for char in " !@#$%^&*(){}:\";'[]<>,.\\/?":
|
||||
|
|
Loading…
Reference in New Issue