Permalink
Browse files

#316 Use kwargs to build operations

  • Loading branch information...
To-om committed Jul 31, 2018
1 parent c90b744 commit a9392fa83f9a40b1fde8f07c0355e911c575054c
Showing with 7 additions and 6 deletions.
  1. +7 −6 contrib/cortexutils/responder.py
@@ -8,25 +8,26 @@
class Responder(Worker):
def __init__(self):
Worker.__init__(self)
Worker.__init__(self)
# Not breaking compatibility
self.artifact = self._input
self.artifact = self._input
def get_data(self):
"""Wrapper for getting data from input dict.
:return: Data (observable value) given through Cortex"""
return self.get_param('data', None, 'Missing data field')
return self.get_param('data', None, 'Missing data field')
def build_operation(self, op_type, parameters={}):
@staticmethod
def build_operation(op_type, **parameters):
"""
:param op_type: an operation type as a string
:param parameters: a dict including the operation's params
:param parameters: a dict including the operation's params
:return: dict
"""
operation = {
'type': op_type
'type': op_type
}
operation.update(parameters)

0 comments on commit a9392fa

Please sign in to comment.