4
CONFIG_PATH = os.path.expanduser('~/.vomun/config.json')
6
## Setup global variables
15
globals['anon+']['banner'] = '''
16
======================
19
======================
22
## Load and setup the configuration file
23
class Configuration(dict):
24
'''A class to hold the contents of configuration files.'''
27
'''Load the configuration file from the location set in self.path.
28
The loaded data is parsed for json contents.
31
config_file = open(self.path, 'r')
32
values = json.loads(config_file.read())
36
self[value] = values[value]
39
self['vomundir'] = os.path.expanduser('~/.vomun/')
44
'''Save the configuration enteries in a json format to the location set
47
config_file = open(self.path, 'w')
48
config_file.write(json.dumps(self, indent = 2))
51
config = Configuration()
b'\\ No newline at end of file'