config.py 626 B

123456789101112131415
  1. # return a configuration objects with default values
  2. def myCar_read_config_defaults(config):
  3. import configparser
  4. if not config.sections():
  5. # there is nothing, lets setup default values
  6. config['paths'] = { 'app' : '/opt/myCar',
  7. 'log' : 'data/log',
  8. 'record' : 'data/rec' }
  9. config['connections'] = { 'bt_dev' : '/dev/rfcomm',
  10. 'gps_dev' : '/dev/ttyS1',
  11. 'wifi_pwd' : 'myCar123' }
  12. # return a valid config object either
  13. # with or without default values
  14. return config