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.

15 lines
561 B

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