Mercurial > hg > audio-degradation-toolbox
comparison html_gen/generate_html.py @ 6:2a219bedc712
added very simple html generating python scripts
author | matthiasm |
---|---|
date | Wed, 21 Aug 2013 18:18:28 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5:a4173509bc43 | 6:2a219bedc712 |
---|---|
1 import sys | |
2 | |
3 args = sys.argv | |
4 wavfilestump = args[1].strip().split(".")[-2].split("/")[-1] | |
5 print wavfilestump | |
6 fileid = wavfilestump.split("_")[-1] | |
7 degid = "_".join(wavfilestump.split("_")[:-1]) | |
8 | |
9 | |
10 html = '''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
11 "http://www.w3.org/TR/html4/loose.dtd"> | |
12 | |
13 <html lang="en"> | |
14 <head> | |
15 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
16 <title>untitled</title> | |
17 <meta name="generator" content="TextMate http://macromates.com/"> | |
18 <meta name="author" content="Matthias Mauch"> | |
19 <!-- Date: 2013-08-20 --> | |
20 </head> | |
21 <body style = "background:#ddd;"> | |
22 <div> | |
23 <div style="float:left;"> | |
24 <h3>Original ({0})</h3> | |
25 <img src="../demoOutput/00_Original_{0}.png" width="800px"/><br> | |
26 <div style="margin-left:auto;margin-right:auto;width:70%"> | |
27 <audio controls> | |
28 <source src="../demoOutput/00_Original_{0}.wav" type="audio/wav"> | |
29 Your browser does not support the audio element. | |
30 </audio> | |
31 </div> | |
32 </div> | |
33 <div style="float:left;"> | |
34 <h3>{1} ({0})</h3> | |
35 <img src="../demoOutput/{1}_{0}.png" width="800px"/><br> | |
36 <div style="margin-left:auto;margin-right:auto;width:70%"> | |
37 <audio controls> | |
38 <source src="../demoOutput/{1}_{0}.wav" type="audio/wav"> | |
39 Your browser does not support the audio element. | |
40 </audio> | |
41 </div> | |
42 </div> | |
43 </div> | |
44 </body> | |
45 </html>'''.format(fileid, degid) | |
46 | |
47 f = open(degid+"_"+fileid+".html", "w") | |
48 print >>f, html |