diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-27 02:27:23 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-27 02:27:23 +0200 |
commit | 940bb6ad6cbd823ed245577093bd8959e189d43f (patch) | |
tree | a3e80900fbb33518d83a0ea3240172bdc821bce6 /helpers/__init__.py | |
parent | 62a8b07a2264101fd6d9c201267966e3c5de0cd4 (diff) | |
download | MusicSampler-940bb6ad6cbd823ed245577093bd8959e189d43f.tar.gz MusicSampler-940bb6ad6cbd823ed245577093bd8959e189d43f.tar.zst MusicSampler-940bb6ad6cbd823ed245577093bd8959e189d43f.zip |
Add music-path option to the command line
Diffstat (limited to 'helpers/__init__.py')
-rw-r--r-- | helpers/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/helpers/__init__.py b/helpers/__init__.py index 534e168..f1a968b 100644 --- a/helpers/__init__.py +++ b/helpers/__init__.py | |||
@@ -33,6 +33,10 @@ def parse_args(): | |||
33 | default="config.yml", | 33 | default="config.yml", |
34 | required=False, | 34 | required=False, |
35 | help="Config file to load") | 35 | help="Config file to load") |
36 | parser.add_argument("-p", "--music-path", | ||
37 | default=".", | ||
38 | required=False, | ||
39 | help="Folder in which to find the music files") | ||
36 | parser.add_argument("-d", "--debug", | 40 | parser.add_argument("-d", "--debug", |
37 | nargs=0, | 41 | nargs=0, |
38 | action=DebugModeAction, | 42 | action=DebugModeAction, |
@@ -98,6 +102,10 @@ def parse_args(): | |||
98 | Config.channels = args.channels | 102 | Config.channels = args.channels |
99 | Config.sample_width = args.sample_width | 103 | Config.sample_width = args.sample_width |
100 | Config.builtin_mixing = args.builtin_mixing | 104 | Config.builtin_mixing = args.builtin_mixing |
105 | if args.music_path.endswith("/"): | ||
106 | Config.music_path = args.music_path | ||
107 | else: | ||
108 | Config.music_path = args.music_path + "/" | ||
101 | 109 | ||
102 | class DebugModeAction(argparse.Action): | 110 | class DebugModeAction(argparse.Action): |
103 | def __call__(self, parser, namespace, values, option_string=None): | 111 | def __call__(self, parser, namespace, values, option_string=None): |