]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - music_sampler/helpers.py
Add comment action
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler / helpers.py
index 9403875cbfe49a82b91ab5772b42f1452eb78b81..9eb1a950ca50fb8028e7b52dd1d601f0d2a908f7 100644 (file)
@@ -124,6 +124,13 @@ Configs = {
         'help_no': _("Don't show warning when focus is lost"),
         'type': 'boolean'
     },
+    'load_all_musics': {
+        'default': True,
+        'help_yes': _("Load all the musics at launch time (default)"),
+        'help_no': _("Don't load all the musics at launch time (use it if you \
+            have memory problems)"),
+        'type': 'boolean'
+    },
     'list_devices': {
         'help': _("List available sound devices"),
         'type': 'action'
@@ -142,6 +149,7 @@ Configs_order = [
     'language',
     'list_devices',
     'device',
+    'load_all_musics',
 ]
 def parse_args():
     argv = sys.argv[1 :]
@@ -224,7 +232,7 @@ def dump_config():
                 item, max_size, getattr(Config, item)))
 
 def build_config(args):
-    stream = open(Config.yml_file, "r")
+    stream = open(Config.yml_file, "r", encoding='utf8')
     try:
         config = yaml.safe_load(stream)
     except Exception as e: