I have an application that can be started using some user preferences. To do this, I use the Some of those priorities (working directory, logging level ...) are quite wise for my code, I would like to check them each time to modify one of their items. To do this, I currently think of two approaches: Writing a method that examines each item of my preferences, each of them is modified is. Every time an item is changed, it is very simple but not very efficient. Write a check_item method (check_logger, check_command_directory, check_blabla ...) for every preference and every time an item related checker is set, then it will be sent to I think the second approach would be better than before. Will you see some of those design options? Thank you very much The first choice for ordinary simple minor obstacles is my favor, though, as I explained it in comments, I do not think "check one item at a time" valid The approach to being - except for the simplest cases it is because some item values can not be valid or valid based on the value of one or more other items < / P> ConfigParser from the underlying package to the
ConfigParser class. I have received a subclass of
ConfigParser , to specify each time without having to specify / set some preferences for
__getitem __ and
__setitem __ applies the applicable sections, sub-sections and options.
Getattr (self, 'check_% s'% items) (item)
No comments:
Post a Comment