kete: add more documentation for the default settings.ini

This commit is contained in:
Benjamin Tissoires 2019-04-23 11:49:49 +02:00
parent c21c8a4633
commit 146b480a84
1 changed files with 19 additions and 5 deletions

View File

@ -762,12 +762,26 @@ class TuhiKeteShell(cmd.Cmd):
self._config.read(self._config_file) self._config.read(self._config_file)
else: else:
# Populate config file with a configuration example # Populate config file with a configuration example
self._config['11:22:33:44:55:66'] = {
'Orientation': 'Landscape',
'HandlePressure': False
}
with open(self._config_file, 'w') as f: with open(self._config_file, 'w') as f:
self._config.write(f) f.write('''# configuration file for kete
# the file follows a standard .ini format:
# each device should have its own section like the following
# [Bluetooth Address]
# in each section, possible keys are:
# - Orientation (possible values: Portrait, Landscape,
# Reverse-Portrait, Reverse-Landscape
# defaults to Landscape)
# - HandlePressure (possible values: true, false
# defaults to false)
# Example:
[11:22:33:44:55:66]
Orientation = Reverse-Portrait
HandlePressure = true
''')
self._history_file = os.path.join(CONFIG_PATH, 'histfile') self._history_file = os.path.join(CONFIG_PATH, 'histfile')