fic: Make pep8 happy

pull/227/head
Raphaël Vinot 2020-01-30 11:38:56 +01:00
parent 8d01493a97
commit 620ac3600c
1 changed files with 16 additions and 12 deletions

View File

@ -39,6 +39,7 @@ argParser = argparse.ArgumentParser(description='Generate documentation from MIS
argParser.add_argument('-v', action='store_true', help='Verbose mode')
args = argParser.parse_args()
def header(adoc=False):
if adoc is False:
return False
@ -66,6 +67,7 @@ def header(adoc=False):
doc = doc + "= MISP objects\n"
return doc
def asciidoc(content=False, adoc=None, t='title', title=''):
adoc = adoc + "\n"
@ -73,14 +75,14 @@ def asciidoc(content=False, adoc=None, t='title',title=''):
if t == 'title':
output = '== ' + content
elif t == 'info':
content = content.rstrip('\.')
content = content.rstrip('.')
output = "\n{}.\n\n{} {} {}{}/definition.json[*this location*] {}.\n".format(content, 'NOTE: ', title, 'is a MISP object available in JSON format at https://github.com/MISP/misp-objects/blob/master/objects/', title.lower(), ' The JSON format can be freely reused in your application or automatically enabled in https://www.github.com/MISP/MISP[MISP]')
elif t == 'author':
output = '\nauthors:: {}\n'.format(' - '.join(content))
elif t == 'value':
output = '=== ' + content
elif t == 'description':
content = content.rstrip('\.')
content = content.rstrip('.')
output = '\n{}\n'.format(content)
elif t == 'attributes':
# output = '\n{}\n'.format
@ -113,6 +115,7 @@ def asciidoc(content=False, adoc=None, t='title',title=''):
adoc = adoc + output
return adoc
adoc = ""
print(header(adoc=adoc))
@ -138,4 +141,5 @@ with open('../relationships/definition.json') as filerelationships:
output = output + '\n|===\n'
adoc = adoc + output
print(adoc)