diff create_html.py @ 0:d2738fed5e8b draft

Uploaded
author bgruening
date Tue, 14 Jan 2014 09:26:18 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/create_html.py	Tue Jan 14 09:26:18 2014 -0500
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import zipfile
+
+
+os.chdir(sys.argv[2])
+o = open( 'results.html', 'w+' )
+
+
+o.write('<html> <body> <h1> ExpaRNA Result </h1>' )
+
+for filename in os.listdir( sys.argv[2] ):
+    if os.path.isfile( os.path.join( sys.argv[2], filename) ) and False ==(filename.endswith('epm') or filename.endswith('fa') or filename.endswith('aln') or filename.endswith('html')):
+        o.write( '<img src="%s" /><br />' % ( filename ))
+
+o.write( '</body></html>' )
+o.close()
+
+# create zip file
+
+zf = zipfile.ZipFile(sys.argv[1], mode='w')
+for files in os.listdir(sys.argv[2]):
+        zf.write(files)
+zf.close()