diff options
author | JoaK <joak@nospace.at> | 2016-06-15 02:23:10 +0200 |
---|---|---|
committer | JoaK <joak@nospace.at> | 2016-06-15 02:23:10 +0200 |
commit | e6b1a6b6959240cdd85732fb1e5095e53728e5fe (patch) | |
tree | 017617320e044772301162aa196b4e0a789f554a /site.py | |
parent | ed976b552e41573ecb40de6badcd1545811e7f53 (diff) |
more to commit
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 - + |