From feac6063f726f36f2fe2208c26bfb6c14defdf98 Mon Sep 17 00:00:00 2001 From: Tim Lehr Date: Thu, 31 Aug 2023 11:56:25 -0700 Subject: [PATCH] fixed `doc-plugins-update` when custom hooks are in environment (#1644) Signed-off-by: Tim Lehr --- .../console/autogen_plugin_documentation.py | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/py-opentimelineio/opentimelineio/console/autogen_plugin_documentation.py b/src/py-opentimelineio/opentimelineio/console/autogen_plugin_documentation.py index fde2220d6..fe776fbce 100644 --- a/src/py-opentimelineio/opentimelineio/console/autogen_plugin_documentation.py +++ b/src/py-opentimelineio/opentimelineio/console/autogen_plugin_documentation.py @@ -270,6 +270,11 @@ def _manifest_formatted( for pt in otio.plugins.manifest.OTIO_PLUGIN_TYPES: pt_lines = [] + if pt == "hooks": + # hooks get handled differently by plugin_info_map() so we will skip them + display_map[pt] = "" + continue + sorted_plugins = [ plugin_info_map[pt][name] for name in sorted(plugin_info_map[pt].keys()) @@ -316,21 +321,26 @@ def generate_and_write_documentation_plugins( manifest_path_list = plugin_info_map['manifests'][:] if public_only: - manifest_path_list = manifest_path_list[:2] + # keep only core manifests + manifest_path_list = [ + p for p in manifest_path_list + if p.replace("\\", PATH_SEP).split(PATH_SEP)[-3] == "opentimelineio" + ] + + sanitized_path_list = manifest_path_list.copy() - sanitized_paths = manifest_path_list[:] if sanitized_paths: # conform all paths to unix-style path separators and leave relative # paths (relative to root of OTIO directory) - sanitized_paths = [ + sanitized_path_list = [ PATH_SEP.join(p.replace("\\", PATH_SEP).split(PATH_SEP)[-3:]) - for p in manifest_path_list + for p in sanitized_path_list ] - manifest_list = "\n".join(f"- `{mp}`" for mp in sanitized_paths) + manifest_list = "\n".join(f"- `{mp}`" for mp in sanitized_path_list) core_manifest_path = manifest_path_list[0] - core_manifest_path_sanitized = sanitized_paths[0] + core_manifest_path_sanitized = sanitized_path_list[0] core_manifest_text = _manifest_formatted( plugin_info_map, [core_manifest_path], @@ -340,7 +350,7 @@ def generate_and_write_documentation_plugins( local_manifest_text = "" if len(plugin_info_map) > 2 and not public_only: local_manifest_paths = manifest_path_list[2:] - local_manifest_paths_sanitized = sanitized_paths[2:] + local_manifest_paths_sanitized = sanitized_path_list[2:] local_manifest_list = "\n".join( f"- `{mp}`" for mp in local_manifest_paths_sanitized )