Hi Pritish
Welcome to the forums and thanks for posting this here!
The following is supported:
"{$HOOK_PATH}/path/to/foo.py:{$HOOK_LOCATION_50}/path/to/fooChild.py"
This will mean that the hook class in fooChild.py
will derive from the class in foo.py
.
However, this syntax isn’t supported:
"{$HOOK_PATH}/path/to/foo.py;{$HOOK_LOCATION_2}/path/to/fooBar.py;"
I assume by the syntax you would like to provide a list of locations in which to look for the hook?
If that is the case then I think you could make use of the template.py hook to resolve the path you want to use.
Here is a simple example of how to do that. Using the publisher collector hook as an example you could set the publisher settings to:
settings.tk-multi-publish2.standalone:
collector: "hook:find_hook_location:{$BROKEN_PATH}/broken_collector.py:{$FIRST_PATH}/first_collector.py:{$SECOND_PATH}/second_collector.py"
And copy the template hook to your config/core/hooks
directory and rename it to find_hook_location.py
.
Then inside the hook you could check each passed path to see if it exists, and if it does then you could stop and return it. You could expand upon this and get more complicated if you needed hook inheritance and multiple paths.
Note: If you are using the template hook, the :
characters don’t represent inheritance anymore. Instead, all colons after the hook name represent separate parameters to be passed to the hook.
Here is an example of the hook which loops over the provided paths, checks if they exist and returns the first one that does: find_hook_location.py (3.0 KB)
Hope that helps?
Thanks
Phil