# HG changeset patch # User matthiasm # Date 1377105508 -3600 # Node ID 2a219bedc712fc22a7b3df85f3fc6d9366c3e474 # Parent a4173509bc431d82daada93e30061f4919dd0f7e added very simple html generating python scripts diff -r a4173509bc43 -r 2a219bedc712 html_gen/generate_html.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/html_gen/generate_html.py Wed Aug 21 18:18:28 2013 +0100 @@ -0,0 +1,48 @@ +import sys + +args = sys.argv +wavfilestump = args[1].strip().split(".")[-2].split("/")[-1] +print wavfilestump +fileid = wavfilestump.split("_")[-1] +degid = "_".join(wavfilestump.split("_")[:-1]) + + +html = ''' + + + + + untitled + + + + + +
+
+

Original ({0})

+
+
+ +
+
+
+

{1} ({0})

+
+
+ +
+
+
+ +'''.format(fileid, degid) + +f = open(degid+"_"+fileid+".html", "w") +print >>f, html diff -r a4173509bc43 -r 2a219bedc712 html_gen/generate_html2.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/html_gen/generate_html2.py Wed Aug 21 18:18:28 2013 +0100 @@ -0,0 +1,65 @@ +import sys + +args = sys.argv + +html_top = ''' + + + + untitled + + + + + +
+

Audio Degradation Toolbox -- Examples

''' + +html_original = \ +'''

+ + {1}

''' + +html_middle = \ +'''

+ + {1}

''' + +html_bottom = '''
+ ''' + + +fileids = ["file{0}".format(i) for i in range(1,8)] + +degids = ['Unit_01_addNoise', +'Unit_02_addSound', +'Unit_03_applyAliasing', +'Unit_04_applyClipping', +'Unit_05_applyDynamicRangeCompression', +'Unit_06_applyHarmonicDistortion', +'Unit_07_applyMp3Compression', +'Unit_08_applySpeedup', +'Unit_09_applyWowResampling', +'Degr_01_liveRecording', + 'Degr_02_strongMp3Compression', + 'Degr_03_vinylRecording', + 'Degr_04_radioBroadcast', + 'Degr_05_smartPhoneRecording', + 'Degr_06_smartPhonePlayback',] + +print html_top +for fid in fileids: + print "

{0}

".format(fid) + print html_original.format(fid, "00_Original") + for did in degids: + print html_middle.format(fid, did) + print '''
+
''' +print html_bottom \ No newline at end of file