- def load_config(self, config_file):
- # Здесь планируется загрузка конфига из файла - пока так присваивается
- self.conf = {}
- self.conf['default_start_dir'] = '/home/alex/Desktop/python/test/'
- self.conf['default_count'] = 10
- self.conf['ignore_dir_list'] = ['/dev', '/proc', '/sys', '/mnt']
- self.conf['window_width'] = 575
- self.conf['window_height'] = 345
-
- def save_config(self, config_file):
- pass
+ def load_config(self, config_file, config_spec_file):
+ self.conf = ConfigObj(config_file, configspec=config_spec_file)
+ val = Validator()
+ test = self.conf.validate(val)
+ if not test:
+ print 'Failed Load Config File'