commit ae7bce338504aea4e76bec116cdc9664261954f0
parent 6aebc0fd5d88391fd5d6328ade609f459827ccbc
Author: Janus <ysangkok@gmail.com>
Date: Thu, 5 Apr 2018 13:06:43 +0200
lightning: paste sample using clipboard
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gui/kivy/uix/dialogs/lightning_payer.py b/gui/kivy/uix/dialogs/lightning_payer.py
@@ -28,8 +28,8 @@ Builder.load_string('''
text: _('Paste')
on_release: s.do_paste()
Button:
- text: _('Paste sample')
- on_release: s.do_paste_sample()
+ text: _('Paste using xclip')
+ on_release: s.do_paste_xclip()
Button:
text: _('Clear')
on_release: s.do_clear()
@@ -60,8 +60,10 @@ class LightningPayerDialog(Factory.Popup):
def dismiss(self, *args, **kwargs):
super(LightningPayerDialog, self).dismiss(*args, **kwargs)
self.app.wallet.network.lightningrpc.setConsole(None)
- def do_paste_sample(self):
- self.invoice_data = "lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w"
+ def do_paste_xclip(self):
+ import subprocess
+ proc = subprocess.run(["xclip","-sel","clipboard","-o"], stdout=subprocess.PIPE)
+ self.invoice_data = proc.stdout.decode("ascii")
def do_paste(self):
contents = self.app._clipboard.paste()
if not contents: