Rusty Russell
4 years ago
4 changed files with 101 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
#!/usr/bin/env python3 |
|||
|
|||
from pyln.client import Plugin |
|||
import time |
|||
|
|||
plugin = Plugin() |
|||
|
|||
|
|||
@plugin.method("make_notify") |
|||
def make_notify(plugin, request, **kwargs): |
|||
plugin.notify_message(request, "Beginning stage 1") |
|||
for i in range(100): |
|||
plugin.notify_progress(request, i, 100, stage=0, stage_total=2) |
|||
time.sleep(0.01) |
|||
plugin.notify_message(request, "Beginning stage 2", level='debug') |
|||
for i in range(10): |
|||
plugin.notify_progress(request, i, 10, stage=1, stage_total=2) |
|||
time.sleep(0.1) |
|||
return "This worked" |
|||
|
|||
|
|||
plugin.run() |
@ -0,0 +1,16 @@ |
|||
#!/usr/bin/env python3 |
|||
|
|||
from pyln.client import Plugin |
|||
|
|||
plugin = Plugin() |
|||
|
|||
|
|||
@plugin.method("call_make_notify") |
|||
def call_make_notify(plugin, request, **kwargs): |
|||
plugin.notify_message(request, "Starting notification", level='debug') |
|||
plugin.notify_progress(request, 0, 2) |
|||
plugin.notify_progress(request, 1, 2) |
|||
return plugin.rpc.call('make_notify') |
|||
|
|||
|
|||
plugin.run() |
Loading…
Reference in new issue