]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Add error message if the config file doesn't load
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 25 Jul 2016 09:51:54 +0000 (11:51 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 25 Jul 2016 09:51:54 +0000 (11:51 +0200)
helpers/mapping.py

index 0c81af4666fd175058108a3b51975a34f16cf66c..d60e709bde0a80e96be783131d5ad4b847be6faa 100644 (file)
@@ -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)