comparison utils.py @ 32:ae78488e9793 draft

Uploaded
author greg
date Mon, 15 May 2017 08:28:22 -0400
parents 62fe699992a5
children ea2be77b575c
comparison
equal deleted inserted replaced
31:a456fb4d1d44 32:ae78488e9793
54 sys.exit(msg) 54 sys.exit(msg)
55 55
56 56
57 def write_html_output(output, title, dir): 57 def write_html_output(output, title, dir):
58 with open(output, 'w') as fh: 58 with open(output, 'w') as fh:
59 fh.write('<html><head><h3>%s</h3></head>\n' % title) 59 fh.write('<html><head><h3>%s: %d files</h3></head>\n' % (title, len(os.listdir(dir))))
60 fh.write('<body><p/><table cellpadding="2">\n') 60 fh.write('<body><p/><table cellpadding="2">\n')
61 fh.write('<tr><th>Size</th><th>Name</th></tr>\n') 61 fh.write('<tr><th>Size</th><th>Name</th></tr>\n')
62 for index, fname in enumerate(sorted(os.listdir(dir))): 62 for index, fname in enumerate(sorted(os.listdir(dir))):
63 if index % 2 == 0: 63 if index % 2 == 0:
64 bgcolor = '#D8D8D8' 64 bgcolor = '#D8D8D8'