mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Expose optional_tooltip directly as attribute on the OptionalPyblishPluginMixin for better auto-complete in IDEs
This commit is contained in:
parent
ca03c4d86d
commit
64b6729eec
1 changed files with 7 additions and 3 deletions
|
|
@ -292,6 +292,9 @@ class OptionalPyblishPluginMixin(AYONPyblishPluginMixin):
|
|||
```
|
||||
"""
|
||||
|
||||
# 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."""
|
||||
|
|
@ -304,11 +307,12 @@ class OptionalPyblishPluginMixin(AYONPyblishPluginMixin):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue