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.

13 lines
520 B

  1. import json
  2. import munch
  3. import os
  4. import configparser
  5. path = os.path.dirname(__file__)
  6. parser = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
  7. parser.read(os.path.join(path,'config.ini'))
  8. with open(os.path.join(path,'keycodes.json')) as k:
  9. keycodes = munch.munchify(json.load(k))
  10. config = parser.__dict__['_sections']
  11. for key,value in config['local'].items():
  12. config['local'][key] = os.path.expandvars(value)
  13. loaded = munch.munchify(dict(config = config,keycodes = keycodes))