From: Ismaƫl Bouya Date: Mon, 25 Jul 2016 09:51:54 +0000 (+0200) Subject: Add error message if the config file doesn't load X-Git-Tag: 1.0.0~26 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git;a=commitdiff_plain;h=9c4f705fc6e8ef19973c1977ae8a5b9982cf6ecc Add error message if the config file doesn't load --- 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): self.mixer = Mixer() else: self.mixer = None - self.key_config, self.open_files = self.parse_config() + + try: + self.key_config, self.open_files = self.parse_config() + except Exception as e: + error_print("Error while loading configuration: {}".format(e)) + sys.exit() + super(Mapping, self).__init__(**kwargs) self._keyboard = Window.request_keyboard(self._keyboard_closed, self) self._keyboard.bind(on_key_down=self._on_keyboard_down)