diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-18 20:11:54 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-18 20:11:54 +0200 |
commit | 6c44b2313c8c115ee05ffe9106ccd8517ec5c66b (patch) | |
tree | 2e379f7880b2942d1877f5d40cebdb0d453d4d3f | |
parent | 2e4049036ec4d90a9daeff606d821d2ac2d023ce (diff) | |
download | MusicSampler-6c44b2313c8c115ee05ffe9106ccd8517ec5c66b.tar.gz MusicSampler-6c44b2313c8c115ee05ffe9106ccd8517ec5c66b.tar.zst MusicSampler-6c44b2313c8c115ee05ffe9106ccd8517ec5c66b.zip |
Print error when loading yaml
-rw-r--r-- | helpers/mapping.py | 8 |
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 | ||
10 | from .music_file import * | 10 | from .music_file import * |
11 | from .mixer import Mixer | 11 | from .mixer import Mixer |
12 | from . import Config, gain | 12 | from . import Config, gain, error_print |
13 | 13 | ||
14 | class Mapping(RelativeLayout): | 14 | class 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'] |