Browse Source

pylightning: make flake8 happy

Trivial changes to make the code pythonic

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
ppa-0.6.1
Douglas Schilling Landgraf 7 years ago
committed by Christian Decker
parent
commit
cb1a4a5180
  1. 30
      contrib/pylightning/lightning/lightning.py

30
contrib/pylightning/lightning/lightning.py

@ -108,7 +108,8 @@ class LightningRpc(UnixDomainSocketRpc):
def dev_setfees(self, immediate, normal=None, slow=None): def dev_setfees(self, immediate, normal=None, slow=None):
""" """
Set feerate in satoshi-per-kw for {immediate}, {normal} and {slow} Set feerate in satoshi-per-kw for {immediate}, {normal} and {slow}
(each is optional, when set, separate by spaces) and show the value of those three feerates (each is optional, when set, separate by spaces) and show the value
of those three feerates
""" """
payload = { payload = {
"immediate": immediate, "immediate": immediate,
@ -119,7 +120,8 @@ class LightningRpc(UnixDomainSocketRpc):
def listnodes(self, node_id=None): def listnodes(self, node_id=None):
""" """
Show all nodes in our local network view, filter on node {id} if provided Show all nodes in our local network view, filter on node {id}
if provided
""" """
payload = { payload = {
"id": node_id "id": node_id
@ -128,7 +130,8 @@ class LightningRpc(UnixDomainSocketRpc):
def getroute(self, peer_id, msatoshi, riskfactor, cltv=9): def getroute(self, peer_id, msatoshi, riskfactor, cltv=9):
""" """
Show route to {id} for {msatoshi}, using {riskfactor} and optional {cltv} (default 9) Show route to {id} for {msatoshi}, using {riskfactor} and optional
{cltv} (default 9)
""" """
payload = { payload = {
"id": peer_id, "id": peer_id,
@ -149,7 +152,8 @@ class LightningRpc(UnixDomainSocketRpc):
def invoice(self, msatoshi, label, description, expiry=None): def invoice(self, msatoshi, label, description, expiry=None):
""" """
Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour) Create an invoice for {msatoshi} with {label} and {description} with
optional {expiry} seconds (default 1 hour)
""" """
payload = { payload = {
"msatoshi": msatoshi, "msatoshi": msatoshi,
@ -180,7 +184,8 @@ class LightningRpc(UnixDomainSocketRpc):
def waitanyinvoice(self, lastpay_index=None): def waitanyinvoice(self, lastpay_index=None):
""" """
Wait for the next invoice to be paid, after {lastpay_index} (if supplied) Wait for the next invoice to be paid, after {lastpay_index}
(if supplied)
""" """
payload = { payload = {
"lastpay_index": lastpay_index "lastpay_index": lastpay_index
@ -260,8 +265,11 @@ class LightningRpc(UnixDomainSocketRpc):
def pay(self, bolt11, msatoshi=None, description=None, riskfactor=None): def pay(self, bolt11, msatoshi=None, description=None, riskfactor=None):
""" """
Send payment specified by {bolt11} with optional {msatoshi} (if and only if {bolt11} does not have amount), Send payment specified by {bolt11} with optional {msatoshi}
{description} (required if {bolt11} uses description hash) and {riskfactor} (default 1.0) (if and only if {bolt11} does not have amount),
{description} (required if {bolt11} uses description hash)
and {riskfactor} (default 1.0)
""" """
payload = { payload = {
"bolt11": bolt11, "bolt11": bolt11,
@ -375,7 +383,8 @@ class LightningRpc(UnixDomainSocketRpc):
def withdraw(self, destination, satoshi): def withdraw(self, destination, satoshi):
""" """
Send to {destination} address {satoshi} (or "all") amount via Bitcoin transaction Send to {destination} address {satoshi} (or "all")
amount via Bitcoin transaction
""" """
payload = { payload = {
"destination": destination, "destination": destination,
@ -403,4 +412,7 @@ class LightningRpc(UnixDomainSocketRpc):
def dev_forget_channel(self, peerid, force=False): def dev_forget_channel(self, peerid, force=False):
""" Forget the channel with id=peerid """ Forget the channel with id=peerid
""" """
return self.call("dev-forget-channel", payload={"id": peerid, "force": force}) return self.call(
"dev-forget-channel",
payload={"id": peerid, "force": force}
)

Loading…
Cancel
Save