From 41b5672360e321604543b4384714d72a28a5881b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 26 Jul 2017 10:10:12 +0200 Subject: [PATCH] Doesn't require describe_types in MISPAttribute's constructor. --- pymisp/mispevent.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 1356f83..60a23fd 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -50,7 +50,12 @@ except NameError: class MISPAttribute(object): - def __init__(self, describe_types): + def __init__(self, describe_types=None): + if not describe_types: + with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f: + t = json.load(f) + describe_types = t['result'] + self.describe_types = describe_types self.categories = describe_types['categories'] self.types = describe_types['types'] self.category_type_mapping = describe_types['category_type_mappings']