fix: various fixes + add number of elements in each lists

pull/66/head
Alexandre Dulaunoy 2018-03-20 22:34:19 +01:00
parent 9760088941
commit 6b815d76f9
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 6 additions and 3 deletions

View File

@ -73,9 +73,11 @@ def asciidoc(content=False, adoc=None, t='title', title=''):
if t == 'title':
output = '== ' + content
elif t == 'info':
output = "\n{}.\n\n{} {} {} {}.\n".format(content, 'NOTE:' ,title, 'are warning lists available in JSON format at https://github.com/MISP/misp-warninglists/tree/master/lists.' ,'The JSON format can be freely reused in your application or automatically enabled in https://www.github.com/MISP/MISP[MISP]')
output = "\n{}.\n\n{} {} {} {}.".format(content, 'NOTE:' ,title, 'are warning lists available in JSON format at https://github.com/MISP/misp-warninglists/tree/master/lists.' ,'The JSON format can be freely reused in your application or automatically enabled in https://www.github.com/MISP/MISP[MISP]')
elif t == 'description':
content = "\n{} \n".format(content)
output = "\n{} \n".format(content)
elif t == 'list':
output = "The warning list contains {} elements.\n".format(content)
adoc = adoc + output
return adoc
adoc = ""
@ -91,6 +93,7 @@ for warninglist in lists:
if 'matching_attributes' in c:
adoc = asciidoc(content=c['matching_attributes'], adoc=adoc, t='matching_attributes')
if 'list' in c:
adoc = asciidoc(content=c['list'], adoc=adoc, t='list')
cards = len(c['list'])
adoc = asciidoc(content=cards, adoc=adoc, t='list')
print(adoc)