# HG changeset patch # User greg # Date 1495551159 14400 # Node ID 45aa928ed5dfd00a16ee312ca91217482a5bc664 # Parent dff964aa0dd5a57cd6f955b7ce92ed4a61838002 Uploaded diff -r dff964aa0dd5 -r 45aa928ed5df utils.py --- a/utils.py Mon May 22 11:57:35 2017 -0400 +++ b/utils.py Tue May 23 10:52:39 2017 -0400 @@ -57,16 +57,20 @@ def write_html_output(output, title, dir): with open(output, 'w') as fh: dir_items = sorted(os.listdir(dir)) - # Directories can only contain either files or directories, but not both. - item_path = os.path.join(dir, dir_items[0]) - if os.path.isdir(item_path): - header = 'Directories' + # Directories can only contain either files or directories, + # but not both. + if len(dir_items) > 0: + item_path = os.path.join(dir, dir_items[0]) + if os.path.isdir(item_path): + header = 'Directories' + else: + header = 'Datasets' else: - header = 'Datasets' - fh.write('
%s |
---|