As discussed a few times, @matterhorn103 has been suggesting a new strategy for plugins (e.g., load at install, use pyproject.toml)
He provided a loose demo for discussion is at avo-plugin-demo/pyproject.toml at dd417d51e10e5525d4a2def6bc197fa3f040a498 · matterhorn103/avo-plugin-demo · GitHub
What’s implied is that for all plugins like this, there would be one and only one project.scripts .. otherwise, there’s no way to indicate to Avogadro that some features / subcommands get called from one script and others get called from another script (e.g., the way the current input generators work with a bunch of orca.py in a folder.
I’m opening up this topic to discuss some brainstorming for the syntax (i.e., so I can go implement the C++ side).
Okay, here’s a useful piece:
[[tool.avogadro.charges]]
subcommand = "get-charges"
method-name = "Löwdiken analysis"
[[tool.avogadro.commands]]
subcommand = "transmute"
path.menu = "Build" # The menu within which the command's menu entry should appear
path.entry = { label = "Transmute into gold", priority = 300 } # The text for the command's menu entry and its position within "Build"
I don’t like subcommand here (i.e., Avogadro is supposed to run plugin transmute [options] on the command-line.
My alternatives:
actioncallinvoke(?)feature
Okay, then there’s the method-name. In the current code, there’s a distinction between name (which will be translated) and identifier (which is how you refer to it in code and not translated). I’m okay if we want to use method-name instead of name for things like charge models and energy calculators with the default that the identifier will be the same.. but I just want to make it clear that names should be translatable.
Finally, there’s the whole menu bit… I’d rather have one string like “&Build | Demo | Transmute” but I guess my bigger question is why path.menu and path.entry and not just menu and entry or menu_item?