mirror of https://github.com/MISP/PyMISP
chg: Add more typing information
parent
0f59cf1ba5
commit
aa17663b58
491
pymisp/api.py
491
pymisp/api.py
File diff suppressed because it is too large
Load Diff
|
@ -926,7 +926,7 @@ class MISPEvent(AbstractMISP):
|
||||||
with open(event_path, 'rb') as f:
|
with open(event_path, 'rb') as f:
|
||||||
self.load(f, validate, metadata_only)
|
self.load(f, validate, metadata_only)
|
||||||
|
|
||||||
def load(self, json_event: Union[IO, str, bytes], validate: bool=False, metadata_only: bool=False):
|
def load(self, json_event: Union[IO, str, bytes, dict], validate: bool=False, metadata_only: bool=False):
|
||||||
"""Load a JSON dump from a pseudo file or a JSON string"""
|
"""Load a JSON dump from a pseudo file or a JSON string"""
|
||||||
if hasattr(json_event, 'read'):
|
if hasattr(json_event, 'read'):
|
||||||
# python2 and python3 compatible to find if we have a file
|
# python2 and python3 compatible to find if we have a file
|
||||||
|
|
Loading…
Reference in New Issue