Closed AdamWill closed 1 year ago
This worked first time (bar persnickety linters). That always makes me suspicious, but I think it's actually okay! I tested it in the 'real world' (on my actual blog, which uses the static_comments
plugin, which is affected by the underlying problem here) and it works, and the test suite passes.
bumped the yapsy requirement to 1.12.0, which seems to be the first version with callback_after
in it. we need to use callback_after
not callback
because plugin_info.plugin_object
is set between the two.
Resolved. Note the log message assumes the plugin will always have self.name
- I figured this is safe as other code seems to do the same, but if not, we can make that safer.
Thanks for the fix!
This is a much cleaner (I think) approach to the problem of figuring out the plugin's template path (see #3701). We use yaspy's ability to provide a callback when loading the plugins. The callback is passed a
yaspy.PluginInfo
instance, which conveniently contains a reference to the plugin object itself, and its filesystem path. So we can just add a method on our plugin class to set the filesystem path as an attribute, and have the callback function call that method.Pull Request Checklist
Description