Skip to content

write hook

开普以尔 edited this page Jun 25, 2024 · 2 revisions

How to write

  • poetry new <hook_name>
  • Create a new __init__.py file
from gameyamlspiderandgenerator.hook import BaseHook, HookLoadingSequence
class YourHookName(BaseHook):
    CHANGED : list | None = None # Which key names in the dictionary did you change
    ORDER: HookLoadingSequence = HookLoadingSequence.NORMAL # Load order
    REQUIRE_CONFIG = False # Whether configuration information is required
    def setup(self, data: dict):
        pass  # Your main Hook program

Install

pip install yamlgenerator-hook-<hook_name>
Clone this wiki locally