Skip to content

Commit cf3911e

Browse files
committed
fixed doc-plugins-update when custom hooks are in environment
Signed-off-by: Tim Lehr <[email protected]>
1 parent 6ac5e90 commit cf3911e

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/py-opentimelineio/opentimelineio/console/autogen_plugin_documentation.py

+17-7
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ def _manifest_formatted(
270270
for pt in otio.plugins.manifest.OTIO_PLUGIN_TYPES:
271271
pt_lines = []
272272

273+
if pt == "hooks":
274+
# hooks get handled differently by plugin_info_map() so we will skip them
275+
display_map[pt] = ""
276+
continue
277+
273278
sorted_plugins = [
274279
plugin_info_map[pt][name]
275280
for name in sorted(plugin_info_map[pt].keys())
@@ -316,21 +321,26 @@ def generate_and_write_documentation_plugins(
316321
manifest_path_list = plugin_info_map['manifests'][:]
317322

318323
if public_only:
319-
manifest_path_list = manifest_path_list[:2]
324+
# keep only core manifests
325+
manifest_path_list = [
326+
p for p in manifest_path_list
327+
if p.strip('/').split(PATH_SEP)[-3] == "opentimelineio"
328+
]
329+
330+
sanitized_path_list = manifest_path_list.copy()
320331

321-
sanitized_paths = manifest_path_list[:]
322332
if sanitized_paths:
323333
# conform all paths to unix-style path separators and leave relative
324334
# paths (relative to root of OTIO directory)
325-
sanitized_paths = [
335+
sanitized_path_list = [
326336
PATH_SEP.join(p.replace("\\", PATH_SEP).split(PATH_SEP)[-3:])
327-
for p in manifest_path_list
337+
for p in sanitized_path_list
328338
]
329339

330-
manifest_list = "\n".join(f"- `{mp}`" for mp in sanitized_paths)
340+
manifest_list = "\n".join(f"- `{mp}`" for mp in sanitized_path_list)
331341

332342
core_manifest_path = manifest_path_list[0]
333-
core_manifest_path_sanitized = sanitized_paths[0]
343+
core_manifest_path_sanitized = sanitized_path_list[0]
334344
core_manifest_text = _manifest_formatted(
335345
plugin_info_map,
336346
[core_manifest_path],
@@ -340,7 +350,7 @@ def generate_and_write_documentation_plugins(
340350
local_manifest_text = ""
341351
if len(plugin_info_map) > 2 and not public_only:
342352
local_manifest_paths = manifest_path_list[2:]
343-
local_manifest_paths_sanitized = sanitized_paths[2:]
353+
local_manifest_paths_sanitized = sanitized_path_list[2:]
344354
local_manifest_list = "\n".join(
345355
f"- `{mp}`" for mp in local_manifest_paths_sanitized
346356
)

0 commit comments

Comments
 (0)