I’m a bit stumped on this issue, maybe someone can help. What’s the “proper” way for a plugin command (i.e. the command attribute that a plugin can define, as explained here) to access the rendered Tutor configuration?
In patches we can simply use {{ PLUGINNAME_VARIABLE }} and Jinja2 will do the rest, but I can’t quite wrap my head around what’s the proper way to do this in Python. I am guessing it has something to do with passing the Click context with a @click.pass_obj decorator and then somehow retrieving a configuration object, but I haven’t made much progress beyond that.
If anyone could enlighten me there, I would much appreciate that. Thanks!
Will that also reliably take care of name prefix mangling for configuration values defined by plugins? In other words, if my plugin is named foo and it has a config option named BAR, can I expect that this will allow me to grab both config['FOO_BAR'] (a config option for my own plugin), and config['LMS_HOST'] from Tutor itself?