You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
520 B

import json
import munch
import os
import configparser
path = os.path.dirname(__file__)
parser = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
parser.read(os.path.join(path,'config.ini'))
with open(os.path.join(path,'keycodes.json')) as k:
keycodes = munch.munchify(json.load(k))
config = parser.__dict__['_sections']
for key,value in config['local'].items():
config['local'][key] = os.path.expandvars(value)
loaded = munch.munchify(dict(config = config,keycodes = keycodes))