chg: [examples] pythonify properly when needed

pull/426/head
Raphaël Vinot 2019-07-22 12:41:27 +02:00
parent 7bd130b506
commit 1dce91af8f
4 changed files with 6 additions and 6 deletions

View File

@ -25,6 +25,6 @@ if __name__ == '__main__':
continue
if eo:
response = pymisp.add_object(args.event, eo)
response = pymisp.add_object(args.event, eo, pythonify=True)
for ref in eo.ObjectReference:
r = pymisp.add_object_reference(ref)

View File

@ -28,11 +28,11 @@ if __name__ == '__main__':
r = pymisp.add_object(args.event, s)
if peo:
r = pymisp.add_object(args.event, peo)
r = pymisp.add_object(args.event, peo, pythonify=True)
for ref in peo.ObjectReference:
r = pymisp.add_object_reference(ref)
if fo:
response = pymisp.add_object(args.event, fo)
response = pymisp.add_object(args.event, fo, pythonify=True)
for ref in fo.ObjectReference:
r = pymisp.add_object_reference(ref)

View File

@ -24,6 +24,6 @@ if __name__ == '__main__':
traceback.print_exc()
continue
response = pymisp.add_object(args.event, auth_keys)
response = pymisp.add_object(args.event, auth_keys, pythonify=True)
for ref in auth_keys.ObjectReference:
r = pymisp.add_object_reference(ref)

View File

@ -67,7 +67,7 @@ if __name__ == '__main__':
event.info = args.new_event
for o in objects:
event.add_object(**o)
new_event = misp.add_event(event)
new_event = misp.add_event(event, pythonify=True)
if isinstance(new_event, str):
print(new_event)
elif 'id' in new_event:
@ -77,7 +77,7 @@ if __name__ == '__main__':
print(new_event)
else:
for o in objects:
new_object = misp.add_object(args.update_event, o)
new_object = misp.add_object(args.update_event, o, pythonify=True)
if isinstance(new_object, str):
print(new_object)
elif new_object.attributes: