70a3e3bad93794676b5d153569b76a1207545da2
[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
9     def __init__(self):
10         self.config = Config_Abstraction('findit.cfg')
11         #conf_ui = Config_Presentation()
12     
13     def get(self, param):
14         return self.config.get_val(param)
15
16 class Config_Abstraction(object):
17
18     def __init__(self, config_file):
19         self.load_config(config_file)
20
21     def get_val(self, param):
22         return self.conf[param]
23
24     def set_val(self, param, value):
25         self.conf[param] = value
26
27     def load_config(self, config_file):
28         # Здесь планируется загрузка конфига из файла - пока так присваивается
29         self.conf = {}
30         self.conf['default_start_dir'] = '/home/alex/Desktop/python/test/'
31         self.conf['default_count'] = 10
32         self.conf['ignore_dir_list'] = ['/dev', '/proc', '/sys', '/mnt']
33
34     def save_config(self, config_file):
35         pass
36
37
38 class Config_Presentation(gtk.Window):
39     def __init__(self):
40         gtk.Window.__init__(self)
41         self.set_border_width(4)
42         self.connect('delete_event', gtk.main_quit)
43
44     def run(self):
45         self.show_all()
46         gtk.main()