X-Git-Url: http://git.wpitchoune.net/gitweb/?p=radio.git;a=blobdiff_plain;f=mp3tohtml%2Fmp3tohtml.py;fp=mp3tohtml%2Fmp3tohtml.py;h=db32bdc832f20546ddfa613bb2d819c6071cfd62;hp=0ef84de5f62d2f93d2a4ef638e815685a09d7dab;hb=7e54698dac1c2122ec5a9d450698d988317534ca;hpb=b44d2202214aa7c5db2bea9013ce34e9631d2a9b diff --git a/mp3tohtml/mp3tohtml.py b/mp3tohtml/mp3tohtml.py index 0ef84de..db32bdc 100755 --- a/mp3tohtml/mp3tohtml.py +++ b/mp3tohtml/mp3tohtml.py @@ -15,7 +15,6 @@ import eyeD3 import fnmatch import glob import os -import os.path import re import sys @@ -43,23 +42,27 @@ def fma_copyright_to_html(path, copyright): return copyright def copy_header(path): - header_path = os.path.dirname(path) + "/header.tpl" + header_path = path + "/header.tpl" header = open(header_path, "r") for line in header: sys.stdout.write(line) def copy_footer(path): - footer_path = os.path.dirname(path) + "/footer.tpl" + footer_path = path + "/footer.tpl" footer = open(footer_path, "r") for line in footer: sys.stdout.write(line) parser = argparse.ArgumentParser(description='Generate an HTML containing information about the MP3 files.') parser.add_argument('dir', help='The directory containing the MP3 files') +parser.add_argument("--config", help="The directory containing the configuration") args = parser.parse_args() -cfg_dir = sys.argv[0] +if (args.config is None): + cfg_dir = os.path.dirname(sys.argv[0]) +else: + cfg_dir = args.config copy_header(cfg_dir)