Merge branch 'master' of github.com:MISP/PyMISP

pull/3/head
Alexandre Dulaunoy 2015-11-24 17:17:13 +01:00
commit 654f238e5c
1 changed files with 6 additions and 2 deletions

View File

@ -18,8 +18,12 @@ def init(url, key):
def download_last(m, last, out=None): def download_last(m, last, out=None):
result = m.download_last(last) result = m.download_last(last)
if out is None: if out is None:
if 'response' in result:
for e in result['response']: for e in result['response']:
print(json.dumps(e) + '\n') print(json.dumps(e) + '\n')
else:
print('No results for that time period')
exit(0)
else: else:
with open(out, 'w') as f: with open(out, 'w') as f:
for e in result['response']: for e in result['response']: