1
'''Load the config from ~/.vomun/config.json'''
6
from libs.morado.functions import register_with_api
8
CONFIG_PATH = os.path.expanduser("~/.vomun/config.json")
12
'''Open the configuration file from ~/.vomun/config.json'''
14
configfile = open(CONFIG_PATH,"r+")
17
'vomundir': os.getenv('HOME') + '/.vomun/',
20
configfile = open(CONFIG_PATH, 'a')
21
configfile.write(json.dumps(default_config, indent = 4))
24
configfile = open(CONFIG_PATH, 'r+')
28
config_file = open_config()
32
'''Load the configuration file'''
33
libs.globals.global_vars['config'] = json.loads(config_file.read())
34
config_file.seek(0) # return read/write position to beginning of the file
38
'''Return the contents of the configuration file'''
39
return libs.globals.global_vars["config"]
44
'''Write the configuration file to the hard disk'''
45
config_file.write(json.dumps(libs.globals.global_vars['config'],