mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
modified click_wrap examples and readme
This commit is contained in:
parent
b7d86bee3f
commit
3484a3d79b
2 changed files with 7 additions and 7 deletions
|
|
@ -31,7 +31,7 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
||||||
- addon must implement `get_plugin_paths` which must return dictionary with possible keys `"publish"`, `"load"`, `"create"` or `"actions"`
|
- addon must implement `get_plugin_paths` which must return dictionary with possible keys `"publish"`, `"load"`, `"create"` or `"actions"`
|
||||||
- each key may contain list or string with a path to directory with plugins
|
- each key may contain list or string with a path to directory with plugins
|
||||||
|
|
||||||
## ITrayModule
|
## ITrayAddon
|
||||||
- addon has more logic when used in a tray
|
- addon has more logic when used in a tray
|
||||||
- it is possible that addon can be used only in the tray
|
- it is possible that addon can be used only in the tray
|
||||||
- abstract methods
|
- abstract methods
|
||||||
|
|
@ -46,7 +46,7 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
||||||
- if addon has logic only in tray or for both then should be checking for `tray_initialized` attribute to decide how should handle situations
|
- if addon has logic only in tray or for both then should be checking for `tray_initialized` attribute to decide how should handle situations
|
||||||
|
|
||||||
### ITrayService
|
### ITrayService
|
||||||
- inherits from `ITrayModule` and implements `tray_menu` method for you
|
- inherits from `ITrayAddon` and implements `tray_menu` method for you
|
||||||
- adds action to submenu "Services" in tray widget menu with icon and label
|
- adds action to submenu "Services" in tray widget menu with icon and label
|
||||||
- abstract attribute `label`
|
- abstract attribute `label`
|
||||||
- label shown in menu
|
- label shown in menu
|
||||||
|
|
@ -57,7 +57,7 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
||||||
- these states must be set by addon itself `set_service_running` is default state on initialization
|
- these states must be set by addon itself `set_service_running` is default state on initialization
|
||||||
|
|
||||||
### ITrayAction
|
### ITrayAction
|
||||||
- inherits from `ITrayModule` and implements `tray_menu` method for you
|
- inherits from `ITrayAddon` and implements `tray_menu` method for you
|
||||||
- adds action to tray widget menu with label
|
- adds action to tray widget menu with label
|
||||||
- abstract attribute `label`
|
- abstract attribute `label`
|
||||||
- label shown in menu
|
- label shown in menu
|
||||||
|
|
@ -89,4 +89,4 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
||||||
|
|
||||||
### TrayAddonsManager
|
### TrayAddonsManager
|
||||||
- inherits from `AddonsManager`
|
- inherits from `AddonsManager`
|
||||||
- has specific implementation for Pype Tray tool and handle `ITrayModule` methods
|
- has specific implementation for Pype Tray tool and handle `ITrayAddon` methods
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ method to convert 'click_wrap' object to 'click' object.
|
||||||
Before
|
Before
|
||||||
```python
|
```python
|
||||||
import click
|
import click
|
||||||
from ayon_core.modules import AYONAddon
|
from ayon_core.addon import AYONAddon
|
||||||
|
|
||||||
|
|
||||||
class ExampleAddon(AYONAddon):
|
class ExampleAddon(AYONAddon):
|
||||||
|
|
@ -40,7 +40,7 @@ def mycommand(arg1, arg2):
|
||||||
Now
|
Now
|
||||||
```
|
```
|
||||||
from ayon_core import click_wrap
|
from ayon_core import click_wrap
|
||||||
from ayon_core.modules import AYONAddon
|
from ayon_core.addon import AYONAddon
|
||||||
|
|
||||||
|
|
||||||
class ExampleAddon(AYONAddon):
|
class ExampleAddon(AYONAddon):
|
||||||
|
|
@ -72,7 +72,7 @@ Added small enhancements:
|
||||||
Example:
|
Example:
|
||||||
```python
|
```python
|
||||||
from ayon_core import click_wrap
|
from ayon_core import click_wrap
|
||||||
from ayon_core.modules import AYONAddon
|
from ayon_core.addon import AYONAddon
|
||||||
|
|
||||||
|
|
||||||
class ExampleAddon(AYONAddon):
|
class ExampleAddon(AYONAddon):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue