Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _load_conf(self, section, option):
- # Write conf. is off, until its turned on
- write_conf = False
- try:
- self.Parser.get(section, option)
- except ConfigParser.NoSectionError:
- self.Parser.add_section(section)
- write_conf = True
- except ConfigParser.NoOptionError:
- self.Parser.set(section, option, 'test')
- write_conf = True
- finally:
- if write_conf == True:
- # write conf. if its needed
- self._write_conf()
- try:
- self.__conf_load += 1
- except:
- self.__conf_load = 1
- finally:
- # repeat own function if max write times is not reached
- if not self.__conf_load > Settings.MaxConfLoads:
- print 'load time : ' + `self.__conf_load`
- self._load_conf(section, option)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement