From f9c0d83f798a52c26c59b2a0958dd9e0d0b2d34b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 13 Jun 2018 23:20:21 +0200 Subject: [PATCH] Made variable.set less verbose and more flexible. Replace the syntax like {"action":"variable.set", "args": {"name":"foo", "value":"bar"}} with a more compact {"action":"variable.set", "args":{"foo":"bar"}} --- platypush/plugins/variable.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platypush/plugins/variable.py b/platypush/plugins/variable.py index 745356430..a92471cc6 100644 --- a/platypush/plugins/variable.py +++ b/platypush/plugins/variable.py @@ -15,9 +15,10 @@ class VariablePlugin(Plugin): def get(self, name, default_value=None): return Response(output={name: self._variables.get(name, default_value)}) - def set(self, name, value): - self._variables[name] = value - return Response(output={name: value}) + def set(self, **kwargs): + for (name, value) in kwargs.items(): + self._variables[name] = value + return Response(output=kwargs) def unset(self, name): if name in self._variables: