seeds icon indicating copy to clipboard operation
seeds copied to clipboard

Config Validation

Open briandconnelly opened this issue 13 years ago • 1 comments

It would be nice for a plugin to define the properties that will be associated with it. Then, when loaded, it scans all of the parameters in its config section and gives an error/warning for unrecognized parameters.

briandconnelly avatar Feb 02 '12 22:02 briandconnelly

Maybe have a function like register_config_parameters(name=X, type=X, default=X, description=X) to be called by the class. A function like get_config_parameters() would get the parameters from the config file and return a dict. During get_config_parameters, if it encounters a parameter that's not been registered, could raise a warning (or error if configured). The description could be shown in GUIs or when there's an error with a parameter. Other tools, such as GUIs, could use the description to print help.

briandconnelly avatar May 18 '12 02:05 briandconnelly