Merge branch 'master' of wpitchoune.net:/srv/git/mp3tohtml
[mp3tohtml.git] / scripts / mp3tohtml
1 #!/usr/bin/python2
2
3 # usage: mp3tohtml.py [-h] [--config CONFIG] dir
4 #
5 # Generate an HTML containing information about the MP3 files.
6 #
7 # positional arguments:
8 #  dir              The directory containing the MP3 files
9 #
10 # optional arguments:
11 #  -h, --help       show this help message and exit
12 #  --config CONFIG  The directory containing the configuration
13 #
14 # Last version of this tool can be get from the GIT repository:
15 # http://wpitchoune.net/mp3tohtml
16 #
17 # http://wpitchoune.net/mp3tohtml
18 # Released under the terms of the GPLv2 license.
19 # (c) 2016 Jean-Philippe Orsini <jeanfi@gmail.com>
20
21 import argparse
22 import mp3tohtml
23 import os
24 import sys
25
26 parser = argparse.ArgumentParser(description='Generate an HTML containing information about the MP3 files.')
27 parser.add_argument('dir', help='The directory containing the MP3 files')
28 parser.add_argument("--config", help="The directory containing the configuration")
29
30 args = parser.parse_args()
31
32 if (args.config is None):
33     cfg_dir = os.path.dirname(sys.argv[0])
34 else:
35     cfg_dir = args.config
36
37 mp3tohtml.generate(args.dir, cfg_dir)