import os
def instructions(keys):
html = "
"
html += " | Module | Author | Description |
"
for f in os.listdir("rules/predefined"):
if f.endswith(".tsv"):
try:
with open("rules/predefined/" + f) as tsvfile:
line1 = tsvfile.readline()
line2 = tsvfile.readline()
if "# NAME: " in line1:
name = line1.replace("# NAME: ","")
else: name = f
if "# DESC: " in line2:
desc = line2.replace("# DESC: ","")
else: desc = ""
author = f.split("_")[0]
except:
continue
html += ""
if os.path.exists("rules/" + f):
html += "| Remove: | "
else:
html += "Add: | "
html += "" + name + " | "
html += "" + author + " | "
html += "" + desc + " | "
html += "
"
html += "
"
pushresources = []
replace = {"KEY_PREDEFINED_RULESETS":html}
return (replace,pushresources)