Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Canonical: Preview #1539
Preview: Canonicalization plugin - matches keyvalue against either a list of values, posix extended regex or fnmatch and on a match brings the value to a canonical form
Some examples are in README.md
@markus2330 please review my pull request
I am impressed, much more clean and readable code! I only found minor things.
What about having a preconfigured way to get canonicalization like done in the plugin
bool? Somewhere in the future we could even let the plugin bool depend on this plugin. (We should not do it now, it has advantages that the plugin
bool is self contained.
i'm currently trying to figure out which approach of preconfiguring works best: plugin configuration or the way typedispatcher currently does it (mounting a configuration and letting the plugin read it)
i'm currently trying to figure out which approach of preconfiguring works best: plugin configuration or the way typedispatcher currently does it (mounting a configuration and letting the plugin read it) the latter one seems easier for everything thats more than 3 configuration keys to set. should we give plugins a way to automatically fetch configurations below some specified mountpoint on kdbOpen ?
It would be a great idea to allow plugin configs to be mounted. But it should not be done using kdbOpen within the plugins---we would need framework extensions to do this properly. And I am afraid that is out of scope for lcdproc or even 1.0. For now the best solutions would be: 1. having commonly used options hard coded (such as the suggested bool canonicalization, which is likely the one which is used at most by far (for the tristate bool)). Your current canonical plugin config would allow such hard-coded plugin settings well (as option next to the regex, fnmatch, list..) 2. having a type/spec-dispatcher-like plugin which copies metadata from one place to all other places where needed If the type dispatcher is already capable to copy the canonical metadata to all places which use the same type it would be a nice solution. Otherwise I would refain from bloating the type plugin even more, the review is quite hard because it is already a monster.