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/',
18
'gnupgdir': os.getenv('HOME') + '/.vomun/gnupg/',
21
configfile = open(CONFIG_PATH, 'a')
22
configfile.write(json.dumps(default_config, indent = 4))
25
configfile = open(CONFIG_PATH, 'r+')
29
config_file = open_config()
33
'''Load the configuration file'''
34
libs.globals.global_vars['config'] = json.loads(config_file.read())
35
config_file.seek(0) # return read/write position to beginning of the file
39
'''Return the contents of the configuration file'''
40
return libs.globals.global_vars["config"]
45
'''Write the configuration file to the hard disk'''
46
config_file.write(json.dumps(libs.globals.global_vars['config'],