chg: [tools] remove trailing dot if presents

pull/178/head
Alexandre Dulaunoy 2019-04-21 15:51:57 +02:00
parent a6ed6df86a
commit bb7e8f27f8
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,7 @@
# #
# #
# A simple converter of MISP objects to asciidoctor format # A simple converter of MISP objects to asciidoctor format
# Copyright (C) 2017-2018 Alexandre Dulaunoy # Copyright (C) 2017-2019 Alexandre Dulaunoy
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -73,12 +73,14 @@ 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':
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]') 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': elif t == 'author':
output = '\nauthors:: {}\n'.format(' - '.join(content)) output = '\nauthors:: {}\n'.format(' - '.join(content))
elif t == 'value': elif t == 'value':
output = '=== ' + content output = '=== ' + content
elif t == 'description': elif t == 'description':
content = content.rstrip('\.')
output = '\n{}\n'.format(content) output = '\n{}\n'.format(content)
elif t == 'attributes': elif t == 'attributes':
#output = '\n{}\n'.format #output = '\n{}\n'.format