From b0af30ebe612d10011e5cfadda72a30bf49360e0 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Mon, 13 Jan 2014 17:00:05 -0800 Subject: [PATCH] Fix up syntax a bit --- examples/calculator_client.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/examples/calculator_client.py b/examples/calculator_client.py index e5a7803..5dd1bd0 100755 --- a/examples/calculator_client.py +++ b/examples/calculator_client.py @@ -80,7 +80,7 @@ def main(host): print("PASS") '''Make a request to evaluate 123 + 45 - 67. - # // + The Calculator interface requires that we first call getOperator() to get the addition and subtraction functions, then call evaluate() to use them. But, once again, we can get both functions, call evaluate(), and @@ -119,18 +119,16 @@ def main(host): ''' Note: a one liner version of building the previous request (I highly - recommend not doing it this way, but I just wanted to demonstrate it is - possible to set all of the fields with a dictionary): + recommend not doing it this way for such a complicated structure, but I + just wanted to demonstrate it is possible to set all of the fields with a + dictionary): - eval_promise = calculator.evaluate({"call": - {"function": subtract, - "params": [{"call": - {"function": add, - "params": - [{"literal": 123}, - {"literal": 45}] - }}, - {"literal": 67.0}]}}) + eval_promise = calculator.evaluate( +{'call': {'function': subtract, + 'params': [{'call': {'function': add, + 'params': [{'literal': 123}, + {'literal': 45}]}}, + {'literal': 67.0}]}}) ''' '''Make a request to evaluate 4 * 6, then use the result in two more