diff --git a/tools/adoc_objects.py b/tools/adoc_objects.py index de43cd2..c75e282 100755 --- a/tools/adoc_objects.py +++ b/tools/adoc_objects.py @@ -3,7 +3,7 @@ # # # A simple converter of MISP objects to asciidoctor format -# Copyright (C) 2017 Alexandre Dulaunoy +# Copyright (C) 2017-2018 Alexandre Dulaunoy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -84,14 +84,18 @@ def asciidoc(content=False, adoc=None, t='title',title=''): #output = '\n{}\n'.format #output = '[cols=\",a\"]\n' output = output + '|===\n' - output = output + '|Object attribute | MISP attribute type | Description | Disable correlation\n' + output = output + '|Object attribute | MISP attribute type | Description | Disable correlation | Multiple\n' adoc = adoc + output for v in content['attributes']: disableCorrelation = 'icon:minus[] ' description = 'icon:minus[] ' + multiple = 'icon:minus[] ' if 'disable_correlation' in content['attributes'][v]: if content['attributes'][v]['disable_correlation']: disableCorrelation = 'icon:check[] ' + if 'multiple' in content['attributes'][v]: + if content['attributes'][v]['multiple']: + multiple = 'icon:check[] ' if 'description' in content['attributes'][v]: if content['attributes'][v]['description']: description = '{}'.format(content['attributes'][v]['description']) @@ -101,7 +105,7 @@ def asciidoc(content=False, adoc=None, t='title',title=''): if 'sane_default' in content['attributes'][v]: values = content['attributes'][v]['sane_default'] description = '{} {}'.format(content['attributes'][v]['description'],values) - output = '\n| {} | {} a| {} a| {}\n'.format(v, content['attributes'][v]['misp-attribute'], description ,disableCorrelation) + output = '\n| {} | {} a| {} a| {} a| {}\n'.format(v, content['attributes'][v]['misp-attribute'], description ,disableCorrelation, multiple) adoc = adoc + output output = '\n|===\n' adoc = adoc + output