From 1cbb750e02e572eda1b008d418cece2bb7cbcfe2 Mon Sep 17 00:00:00 2001 From: Janus Date: Tue, 13 Feb 2018 11:15:28 +0100 Subject: [PATCH] lightning: enable arbitrary arguments through json (over stdin) --- lib/commands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/commands.py b/lib/commands.py index 63b962fe..bdc6c6e7 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -694,7 +694,7 @@ class Commands: return sorted(known_commands.keys()) @command("wn") - def lightning(self, lcmd, *args): + def lightning(self, lcmd, args=None): q = queue.Queue() class FakeQtSignal: def emit(self, data): @@ -702,6 +702,10 @@ class Commands: class MyConsole: newResult = FakeQtSignal() self.wallet.lightning.setConsole(MyConsole()) + if args: + args = json_decode(args) + else: + args = [] lightning.lightningCall(self.wallet.lightning, lcmd)(*args) return q.get(block=True, timeout=30)