From 716fd2723c025dc26de72027005f45bac3263034 Mon Sep 17 00:00:00 2001 From: Tobias Mainka Date: Thu, 11 Jan 2018 12:39:19 +0100 Subject: [PATCH] added misp object templates path argument --- pymisp/mispevent.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 1528e04..eb3e052 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -814,9 +814,12 @@ class MISPObject(AbstractMISP): super(MISPObject, self).__init__(**kwargs) self.__strict = strict self.name = name - self.__misp_objects_path = os.path.join( - os.path.abspath(os.path.dirname(sys.modules['pymisp'].__file__)), - 'data', 'misp-objects', 'objects') + if kwargs.get('misp_objects_path', None): + self.__misp_objects_path = kwargs.get('misp_objects_path', None) + else: + self.__misp_objects_path = os.path.join( + os.path.abspath(os.path.dirname(sys.modules['pymisp'].__file__)), + 'data', 'misp-objects', 'objects') if os.path.exists(os.path.join(self.__misp_objects_path, self.name, 'definition.json')): self.__known_template = True else: