0
|
1 #!/usr/bin/env python
|
|
2
|
|
3 import os
|
|
4 import sys
|
|
5 import zipfile
|
|
6
|
|
7
|
|
8 os.chdir(sys.argv[2])
|
|
9 o = open( 'results.html', 'w+' )
|
|
10
|
|
11
|
|
12 o.write('<html> <body> <h1> ExpaRNA Result </h1>' )
|
|
13
|
|
14 for filename in os.listdir( sys.argv[2] ):
|
|
15 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')):
|
|
16 o.write( '<img src="%s" /><br />' % ( filename ))
|
|
17
|
|
18 o.write( '</body></html>' )
|
|
19 o.close()
|
|
20
|
|
21 # create zip file
|
|
22
|
|
23 zf = zipfile.ZipFile(sys.argv[1], mode='w')
|
|
24 for files in os.listdir(sys.argv[2]):
|
|
25 zf.write(files)
|
|
26 zf.close()
|