Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
PushDefinition automatically prefixes output param
Browse files Browse the repository at this point in the history
When adding output params to a PushDefinition, the output param is prefixed with "output_params." so that any subsequent access to it for validate or subscribe calls is correct.
  • Loading branch information
Jairam Chandar committed Jan 7, 2013
1 parent ced5555 commit 361f779
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datasift/__init__.py
Expand Up @@ -917,7 +917,7 @@ def get_output_param(self, key):
"""
Get an output parameter.
"""
return self._output_params[key]
return self._output_params[self.OUTPUT_PARAMS_PREFIX + key]

def get_output_params(self):
"""
Expand All @@ -929,7 +929,7 @@ def set_output_param(self, key, val):
"""
Set an output parameter.
"""
self._output_params[key] = val
self._output_params[self.OUTPUT_PARAMS_PREFIX + key] = val

def validate(self):
"""
Expand Down Expand Up @@ -977,7 +977,7 @@ def subscribe(self, hash_type, hash, name):
'output_type': self.get_output_type()
}
for key in self._output_params:
params[self.OUTPUT_PARAMS_PREFIX + key] = self._output_params[key]
params[key] = self._output_params[key]
if len(self.get_initial_status()) > 0:
params['initial_status'] = self.get_initial_status()

Expand Down

0 comments on commit 361f779

Please sign in to comment.