X-Git-Url: http://git.wpitchoune.net/gitweb/?p=radio.git;a=blobdiff_plain;f=mp3tohtml.py;fp=mp3tohtml.py;h=f0ba0d157af3857e62a120a44ffa29a65793a14e;hp=a683c88eacc23af6168d5a82bc64668ad0580f88;hb=0cb401ee6342433ff43fed9a9f7a4032550a0139;hpb=974601b5acfe90049cde855d50715719a04d061d diff --git a/mp3tohtml.py b/mp3tohtml.py index a683c88..f0ba0d1 100755 --- a/mp3tohtml.py +++ b/mp3tohtml.py @@ -48,12 +48,20 @@ def copy_header(path): for line in header: sys.stdout.write(line) +def copy_footer(path): + footer_path = os.path.dirname(path) + "/header.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') args = parser.parse_args() -copy_header(sys.argv[0]) +cfg_dir = sys.argv[0] + +copy_header(cfg_dir) files = [] for root, dirnames, filenames in os.walk(args.dir): @@ -102,6 +110,8 @@ for f in files: print("\t") +copy_footer(cfg_dir) + print("") print ("