From: Tony Mack Date: Mon, 28 Nov 2011 03:26:44 +0000 (-0500) Subject: initial checkin X-Git-Tag: sfa-2.0-1~6^2~4^2~6 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=07d7c082f2123fa72452507b47aa4f01345abdae;p=sfa.git initial checkin --- diff --git a/sfa/client/return_value.py b/sfa/client/return_value.py new file mode 100644 index 00000000..94ac9cff --- /dev/null +++ b/sfa/client/return_value.py @@ -0,0 +1,22 @@ + +class ReturnValue(dict): + + + @staticmethod + def get_code(return_value): + return ReturnValue.get_key_value('code', return_value) + + @staticmethod + def get_value(return_value): + return ReturnValue.get_key_value('value', return_value) + + @staticmethod + def get_output(return_value): + return ReturnValue.get_key_value('output', return_value) + + @staticmethod + def get_key_value(key, return_value): + if isinstance(return_value, dict): + return return_value.get(key) + else: + return return_value