diff options
Diffstat (limited to 'site.py')
-rw-r--r-- | site.py | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -3,7 +3,29 @@ import os -for file in os.listdir("manuals"): - if file.endswith(".txt"): +folder = "manuals" +header = """""" +middlepart = """""" +footer = """<script src="http://listjs.com/no-cdn/list.js"></script>""" +for file in os.listdir(folder): + if file.endswith(".txt"): + print(file) + filename = file + text = open(folder+"/"+filename, 'r') + title = "" + filename = "" + tags = [] + description = "" + for line in text: + line = line.replace('\n','') + if "Title:" in line: + title = line.replace("Title: ", "") + if "File:" in line: + filename = line.replace("File: ", "") + if "Tags:" in line: + tags = line.replace("Tags: ", "").split(",") + if "Description:" in line: + description = line.replace("Description: ", "") + if - + |