diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-25 11:51:54 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-25 11:51:54 +0200 |
commit | 9c4f705fc6e8ef19973c1977ae8a5b9982cf6ecc (patch) | |
tree | 3b8729bd48438f627741dc72140f79f8ef1dcc3d | |
parent | 54887692c36a97c3310a41f73ba1a53bcdec63b8 (diff) | |
download | MusicSampler-9c4f705fc6e8ef19973c1977ae8a5b9982cf6ecc.tar.gz MusicSampler-9c4f705fc6e8ef19973c1977ae8a5b9982cf6ecc.tar.zst MusicSampler-9c4f705fc6e8ef19973c1977ae8a5b9982cf6ecc.zip |
Add error message if the config file doesn't load
-rw-r--r-- | helpers/mapping.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/helpers/mapping.py b/helpers/mapping.py index 0c81af4..d60e709 100644 --- a/helpers/mapping.py +++ b/helpers/mapping.py | |||
@@ -23,7 +23,13 @@ class Mapping(RelativeLayout): | |||
23 | self.mixer = Mixer() | 23 | self.mixer = Mixer() |
24 | else: | 24 | else: |
25 | self.mixer = None | 25 | self.mixer = None |
26 | self.key_config, self.open_files = self.parse_config() | 26 | |
27 | try: | ||
28 | self.key_config, self.open_files = self.parse_config() | ||
29 | except Exception as e: | ||
30 | error_print("Error while loading configuration: {}".format(e)) | ||
31 | sys.exit() | ||
32 | |||
27 | super(Mapping, self).__init__(**kwargs) | 33 | super(Mapping, self).__init__(**kwargs) |
28 | self._keyboard = Window.request_keyboard(self._keyboard_closed, self) | 34 | self._keyboard = Window.request_keyboard(self._keyboard_closed, self) |
29 | self._keyboard.bind(on_key_down=self._on_keyboard_down) | 35 | self._keyboard.bind(on_key_down=self._on_keyboard_down) |