aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-18 20:11:54 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-18 20:11:54 +0200
commit6c44b2313c8c115ee05ffe9106ccd8517ec5c66b (patch)
tree2e379f7880b2942d1877f5d40cebdb0d453d4d3f
parent2e4049036ec4d90a9daeff606d821d2ac2d023ce (diff)
downloadMusicSampler-6c44b2313c8c115ee05ffe9106ccd8517ec5c66b.tar.gz
MusicSampler-6c44b2313c8c115ee05ffe9106ccd8517ec5c66b.tar.zst
MusicSampler-6c44b2313c8c115ee05ffe9106ccd8517ec5c66b.zip
Print error when loading yaml
-rw-r--r--helpers/mapping.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/helpers/mapping.py b/helpers/mapping.py
index 858fe77..19fc3c5 100644
--- a/helpers/mapping.py
+++ b/helpers/mapping.py
@@ -9,7 +9,7 @@ import sys
9 9
10from .music_file import * 10from .music_file import *
11from .mixer import Mixer 11from .mixer import Mixer
12from . import Config, gain 12from . import Config, gain, error_print
13 13
14class Mapping(RelativeLayout): 14class Mapping(RelativeLayout):
15 expected_keys = NumericProperty(0) 15 expected_keys = NumericProperty(0)
@@ -89,7 +89,11 @@ class Mapping(RelativeLayout):
89 89
90 def parse_config(self): 90 def parse_config(self):
91 stream = open(Config.yml_file, "r") 91 stream = open(Config.yml_file, "r")
92 config = yaml.load(stream) 92 try:
93 config = yaml.load(stream)
94 except yaml.scanner.ScannerError as e:
95 error_print("Error while loading config file: {}".format(e))
96 sys.exit()
93 stream.close() 97 stream.close()
94 98
95 aliases = config['aliases'] 99 aliases = config['aliases']