Imported from archive.
[mudpy.git] / lib / muff / muffconf.py
1 """Configuration objects for the MUFF Engine"""
2
3 # Copyright (c) 2005 mudpy, Jeremy Stanley <fungi@yuggoth.org>, all rights reserved.
4 # Licensed per terms in the LICENSE file distributed with this software.
5
6 # muff configuration files use the ini format supported by ConfigParser
7 import ConfigParser
8
9 # hack to load all modules in teh muff package
10 import muff
11 for module in muff.__all__:
12         exec("import " + module)
13
14 # list of places to look for the config
15 config_dirs = [".", "./etc", "/usr/local/muff", "/usr/local/muff/etc", "/etc/muff", "/etc" ]
16
17 # name of the config file
18 config_name = "muff.conf"
19
20 # build a list of possible config files
21 config_files = []
22 for each_dir in config_dirs:
23         config_files.append(each_dir + "/" + config_name)
24
25 # read the config
26 config_data = ConfigParser.SafeConfigParser()
27 config_data.read(config_files)
28