Skip to content

Conversation

@oprypin
Copy link
Contributor

@oprypin oprypin commented Sep 11, 2022

Add a decorator that sets a priority value for plugins' events.
Events with higher priority are called first.
Events without a chosen priority get a default of 0.
Events that have the same priority are ordered as they appear in the config.

Recommended priority values:
100 "first", 50 "early", 0 "default", -50 "late", -100 "last".
As different plugins discover more precise relations to each other, the values should be further tweaked.

@plugins.event_priority(-100)  # Wishing to run this after all other plugins' `on_files` events.
def on_files(self, files, config, **kwargs):
    ...

Add a decorator that sets a priority value for plugins' events. Events with higher priority are called first. Events without a chosen priority get a default of 0. Events that have the same priority are ordered as they appear in the config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants