b2dab48e8e8af7a18c1844adf48118cd1b5c170f
[findit] / src / config.py
1 #!/usr/bin/env python
2 # -*-coding: utf-8 -*-
3 # vim: sw=4 ts=4 expandtab ai
4
5 import gtk
6
7 class Config_Control(object):
8     def __init__(self):
9         config = Config_Abstraction('findit.cfg')
10         conf_ui = Config_Presentation()
11
12
13 class Config_Abstraction(object):
14     def __init__(self, config_file):
15         self.load_config(config_file)
16
17     def get_val(self, param):
18         return self.conf[param]
19
20     def set_val(self, param, value):
21         self.conf[param] = value
22
23     def load_config(self, config_file):
24         # Здесь планируется загрузка конфига из файла - пока так присваивается
25         self.conf = {}
26         self.conf['default_start_dir'] = '/home/'
27         self.conf['default_count'] = 10
28         self.conf['ignore_dir_list'] = ['/dev', '/proc', '/sys', '/mnt']
29
30     def save_config(self, config_file):
31         pass
32
33
34 class Config_Presentation(gtk.Window):
35     def __init__(self):
36         gtk.Window.__init__(self)
37         self.set_border_width(4)
38         self.connect('delete_event', gtk.main_quit)
39
40     def run(self):
41         self.show_all()
42         gtk.main()