Skip to content

Commit

Permalink
Expose optional_tooltip directly as attribute on the `OptionalPybli…
Browse files Browse the repository at this point in the history
…shPluginMixin` for better auto-complete in IDEs
  • Loading branch information
BigRoy committed Jan 30, 2025
1 parent ca03c4d commit 64b6729
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/ayon_core/pipeline/publish/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def process(self, instance):
```
"""

# Allow exposing tooltip from class with `optional_tooltip` attribute
optional_tooltip: Optional[str] = None

@classmethod
def get_attribute_defs(cls):
"""Attribute definitions based on plugin's optional attribute."""
Expand All @@ -304,11 +307,12 @@ def get_attribute_defs(cls):
active = getattr(cls, "active", True)
# Return boolean stored under 'active' key with label of the class name
label = cls.label or cls.__name__
# Allow exposing tooltip from class with `optional_tooltip` attribute
tooltip = getattr(cls, "optional_tooltip", None)

return [
BoolDef("active", default=active, label=label, tooltip=tooltip)
BoolDef("active",
default=active,
label=label,
tooltip=cls.optional_tooltip)
]

def is_active(self, data):
Expand Down

0 comments on commit 64b6729

Please sign in to comment.