Merge branch 'add-objects-template-file-path' of https://github.com/neok0/PyMISP into neok0-add-objects-template-file-path

pull/175/head
Raphaël Vinot 2018-01-11 22:33:11 +01:00
commit dfac2e2a05
1 changed files with 6 additions and 3 deletions

View File

@ -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: