mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-29 18:27:19 +00:00
pep8, include the misp-galaxy tag in the output
This commit is contained in:
parent
3e5abbf998
commit
bd1f22ad7d
1 changed files with 14 additions and 12 deletions
|
@ -76,6 +76,7 @@ def header():
|
||||||
doc += "= MISP galaxy\n"
|
doc += "= MISP galaxy\n"
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
|
||||||
def asciidoc(content=False, t='title', title='', typename=''):
|
def asciidoc(content=False, t='title', title='', typename=''):
|
||||||
adoc = []
|
adoc = []
|
||||||
adoc += "\n"
|
adoc += "\n"
|
||||||
|
@ -87,7 +88,7 @@ def asciidoc(content=False, t='title',title='', typename=''):
|
||||||
elif t == 'author':
|
elif t == 'author':
|
||||||
output = '\nauthors:: {}\n'.format(' - '.join(content))
|
output = '\nauthors:: {}\n'.format(' - '.join(content))
|
||||||
elif t == 'value':
|
elif t == 'value':
|
||||||
output = '=== ' + content
|
output = '=== {}'.format(content)
|
||||||
elif t == 'description':
|
elif t == 'description':
|
||||||
output = '\n{}\n'.format(content)
|
output = '\n{}\n'.format(content)
|
||||||
elif t == 'meta-synonyms':
|
elif t == 'meta-synonyms':
|
||||||
|
@ -127,9 +128,10 @@ for cluster in clusters:
|
||||||
if 'authors' in c:
|
if 'authors' in c:
|
||||||
adoc += asciidoc(content=c['authors'], t='author', title=title)
|
adoc += asciidoc(content=c['authors'], t='author', title=title)
|
||||||
for v in c['values']:
|
for v in c['values']:
|
||||||
adoc += asciidoc(content=v['value'], t='value', title=title)
|
adoc += asciidoc(content=v['value'], t='value')
|
||||||
if 'description' in v:
|
if 'description' in v:
|
||||||
adoc += asciidoc(content=v['description'], t='description')
|
adoc += asciidoc(content=v['description'], t='description')
|
||||||
|
adoc += asciidoc(content='The tag is: _misp-galaxy:{}="{}"_'.format(c['type'], v['value']), t='description')
|
||||||
if 'meta' in v:
|
if 'meta' in v:
|
||||||
adoc += asciidoc(content=v['meta'], t='meta-synonyms', title=v['value'])
|
adoc += asciidoc(content=v['meta'], t='meta-synonyms', title=v['value'])
|
||||||
if 'related' in v:
|
if 'related' in v:
|
||||||
|
|
Loading…
Reference in a new issue