From 1ff08c7d737e0f12b555422a847f703ac46a32c3 Mon Sep 17 00:00:00 2001 From: Jurriaan Bremer Date: Tue, 16 Aug 2016 18:35:34 +0200 Subject: [PATCH] provide sane defaults for upload-sample/samplelist Most of the arguments are unused when a proper event ID has been provided, hence default them to standard values. --- pymisp/api.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index 79ffc1b..5ac03ba 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -753,15 +753,17 @@ class PyMISP(object): with open(path, 'rb') as f: return str(base64.b64encode(f.read())) - def upload_sample(self, filename, filepath, event_id, distribution, to_ids, - category, comment, info, analysis, threat_level_id): + def upload_sample(self, filename, filepath, event_id, distribution=None, + to_ids=True, category=None, comment=None, info=None, + analysis=None, threat_level_id=None): to_post = self.prepare_attribute(event_id, distribution, to_ids, category, comment, info, analysis, threat_level_id) to_post['request']['files'] = [{'filename': filename, 'data': self._encode_file_to_upload(filepath)}] return self._upload_sample(to_post) - def upload_samplelist(self, filepaths, event_id, distribution, to_ids, category, - info, analysis, threat_level_id): + def upload_samplelist(self, filepaths, event_id, distribution=None, + to_ids=True, category=None, info=None, + analysis=None, threat_level_id=None): to_post = self.prepare_attribute(event_id, distribution, to_ids, category, info, analysis, threat_level_id) files = []