Context of the macro plugin
Tomas
Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭
Hi,
when I use the macro plugin in Project's macro page or in Scenario, is it possible to access the context of the call inside the macro code? Like get the handle of the project or scenario here:
class MyRunnable(Runnable): def __init__(self, project_key, config, plugin_config): """ :param project_key: the project in which the runnable executes :param config: the dict of the configuration of the object :param plugin_config: contains the plugin settings """ self.project_key = project_key self.config = config self.plugin_config = plugin_config
Thanks
Best Answer
-
Hi,
macros don't receive a context, only their settings. You can sort of guess the context from the current working directory, though
Answers
-
Thanks for the answer, I was hoping that there is a way. It would be super cool to have it in the future versions, as for example macro dealing with datasets cannot directly access the Project object and thus list the available datasets and its metadata.