fix: various fixes + add number of elements in each lists
parent
9760088941
commit
6b815d76f9
|
@ -73,9 +73,11 @@ def asciidoc(content=False, adoc=None, t='title', title=''):
|
||||||
if t == 'title':
|
if t == 'title':
|
||||||
output = '== ' + content
|
output = '== ' + content
|
||||||
elif t == 'info':
|
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':
|
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
|
adoc = adoc + output
|
||||||
return adoc
|
return adoc
|
||||||
adoc = ""
|
adoc = ""
|
||||||
|
@ -91,6 +93,7 @@ for warninglist in lists:
|
||||||
if 'matching_attributes' in c:
|
if 'matching_attributes' in c:
|
||||||
adoc = asciidoc(content=c['matching_attributes'], adoc=adoc, t='matching_attributes')
|
adoc = asciidoc(content=c['matching_attributes'], adoc=adoc, t='matching_attributes')
|
||||||
if 'list' in c:
|
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)
|
print(adoc)
|
||||||
|
|
Loading…
Reference in New Issue