briandconnelly / seeds

Stochastic Cellular Artificial Life Simulator
Other
20 stars 4 forks source link

Config Validation #62

Open briandconnelly opened 12 years ago

briandconnelly commented 12 years ago

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 commented 12 years ago

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.