Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for plugin version numbers #1585

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/tutorials/otio-serialized-schema-only-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ parameters:
- *filepath*
- *name*
- *suffixes*
- *version*

## Module: opentimelineio.core

Expand Down Expand Up @@ -78,6 +79,7 @@ parameters:
parameters:
- *filepath*
- *name*
- *version*

## Module: opentimelineio.media_linker

Expand All @@ -86,6 +88,7 @@ parameters:
parameters:
- *filepath*
- *name*
- *version*

## Module: opentimelineio.opentime

Expand Down Expand Up @@ -125,6 +128,7 @@ parameters:
parameters:
- *filepath*
- *name*
- *version*

## Module: opentimelineio.schema

Expand Down Expand Up @@ -280,3 +284,4 @@ parameters:
parameters:
- *filepath*
- *name*
- *version*
5 changes: 5 additions & 0 deletions docs/tutorials/otio-serialized-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ parameters:
- *filepath*: Absolute path or relative path to adapter module from location of json.
- *name*: Adapter name.
- *suffixes*: File suffixes associated with this adapter.
- *version*: Version number of plugin defined in manifest.

## Module: opentimelineio.core

Expand Down Expand Up @@ -158,6 +159,7 @@ None
parameters:
- *filepath*: Absolute path or relative path to adapter module from location of json.
- *name*: Adapter name.
- *version*: Version number of plugin defined in manifest.

## Module: opentimelineio.media_linker

Expand All @@ -174,6 +176,7 @@ None
parameters:
- *filepath*: Absolute path or relative path to adapter module from location of json.
- *name*: Adapter name.
- *version*: Version number of plugin defined in manifest.

## Module: opentimelineio.opentime

Expand Down Expand Up @@ -271,6 +274,7 @@ A class of plugin that is encoded in a python module, exposed via a
parameters:
- *filepath*: Absolute path or relative path to adapter module from location of json.
- *name*: Adapter name.
- *version*: Version number of plugin defined in manifest.

## Module: opentimelineio.schema

Expand Down Expand Up @@ -675,3 +679,4 @@ None
parameters:
- *filepath*: Absolute path or relative path to adapter module from location of json.
- *name*: Adapter name.
- *version*: Version number of plugin defined in manifest.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def main():
print(" (none found)")

for plug in plugins:
print(f" {plug.name}")
print(f" {plug.name} - version: {getattr(plug, 'version') or'unknown'}")

try:
info = plug.plugin_info_map()
Expand Down
8 changes: 8 additions & 0 deletions src/py-opentimelineio/opentimelineio/plugins/python_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(
core.SerializableObject.__init__(self)
self.name = name
self.filepath = filepath
self.version = None
self._json_path = None
self._module = None

Expand All @@ -73,6 +74,13 @@ def __init__(
" json."
)
)
version = core.serializable_field(
"version",
str,
doc=(
"Version number of plugin defined in manifest."
)
)

def plugin_info_map(self):
"""Returns a map with information about the plugin."""
Expand Down