more work done on install.py

This commit is contained in:
Paul Houser 2020-08-24 00:47:57 -07:00
parent da735327cb
commit 927c607839

View File

@ -68,10 +68,33 @@ def print_keys(dictionary):
if isinstance(dictionary[key], dict): if isinstance(dictionary[key], dict):
print_keys(dictionary[key]) print_keys(dictionary[key])
def gen_columns(html_file): def gen_col_headers(html_file, file_dict):
print("here") for key in file_dict:
html_file.write("<li>\n")
html_file.write(" <h1>" + key + "</h1>\n")
html_file.write(" <ul>\n")
def gen_html(): # generate list indices
html_file.write(" </ul>\n")
html_file.write("</li>\n")
def gen_columns(html_file, file_dict):
for key in file_dict:
html_file.write("<div class=\"column\">\n")
html_file.write(" <div class=\"tree\">\n")
html_file.write(" <h1>.</h1>\n")
html_file.write(" <ul>\n")
# generate the column headers
gen_col_headers(html_file, file_dict[key])
html_file.write(" </ul>\n")
html_file.write(" </div>\n")
html_file.write("</div>\n")
def gen_html(file_dict):
print("Generating index.html...") print("Generating index.html...")
# open files # open files
@ -81,8 +104,8 @@ def gen_html():
# copy skeleton_html to cache_html until Column Start comment # copy skeleton_html to cache_html until Column Start comment
lines = skeleton_html.readlines() lines = skeleton_html.readlines()
for line in lines: for line in lines:
if line == "<!-- Columns start -->": if line == "<!-- Columns start -->\n":
gen_columns(cache_html) gen_columns(cache_html, file_dict)
else: else:
cache_html.write(line) cache_html.write(line)
@ -92,7 +115,10 @@ def gen_html():
print("Done!") print("Done!")
if __name__ == '__main__': def main():
setup() setup()
file_dict = parse_yaml() file_dict = parse_yaml()
gen_html() gen_html(file_dict)
if __name__ == '__main__':
main()