mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
lint: Changes for flake8 7.2
This commit is contained in:
@@ -42,7 +42,6 @@ def make_rpc_func(port, auth, host="127.0.0.1"):
|
|||||||
host = host
|
host = host
|
||||||
|
|
||||||
def rpc_func(method, params=None):
|
def rpc_func(method, params=None):
|
||||||
nonlocal port, auth, host
|
|
||||||
return callrpc(port, auth, method, params, host)
|
return callrpc(port, auth, method, params, host)
|
||||||
|
|
||||||
return rpc_func
|
return rpc_func
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ def make_rpc_func(port, auth, wallet=None, host="127.0.0.1"):
|
|||||||
host = host
|
host = host
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet_override=None):
|
def rpc_func(method, params=None, wallet_override=None):
|
||||||
nonlocal port, auth, wallet, host
|
|
||||||
return callrpc(
|
return callrpc(
|
||||||
port,
|
port,
|
||||||
auth,
|
auth,
|
||||||
|
|||||||
@@ -309,7 +309,6 @@ def make_xmr_rpc2_func(
|
|||||||
transport.set_proxy(proxy_host, proxy_port)
|
transport.set_proxy(proxy_host, proxy_port)
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet=None, timeout=default_timeout):
|
def rpc_func(method, params=None, wallet=None, timeout=default_timeout):
|
||||||
nonlocal port, auth, host, transport, tag
|
|
||||||
return callrpc_xmr2(
|
return callrpc_xmr2(
|
||||||
port,
|
port,
|
||||||
method,
|
method,
|
||||||
@@ -345,7 +344,6 @@ def make_xmr_rpc_func(
|
|||||||
transport.set_proxy(proxy_host, proxy_port)
|
transport.set_proxy(proxy_host, proxy_port)
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet=None, timeout=default_timeout):
|
def rpc_func(method, params=None, wallet=None, timeout=default_timeout):
|
||||||
nonlocal port, auth, host, transport, tag
|
|
||||||
return callrpc_xmr(
|
return callrpc_xmr(
|
||||||
port,
|
port,
|
||||||
method,
|
method,
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ def make_reporthook(read_start: int, logger):
|
|||||||
logger.info(f"Attempting to resume from byte {read_start}")
|
logger.info(f"Attempting to resume from byte {read_start}")
|
||||||
|
|
||||||
def reporthook(blocknum, blocksize, totalsize):
|
def reporthook(blocknum, blocksize, totalsize):
|
||||||
nonlocal read, last_percent_str, time_last, read_last, display_last, read_start
|
nonlocal read, last_percent_str, time_last, read_last, display_last, abo
|
||||||
nonlocal average_buffer, abo, logger
|
|
||||||
read += blocksize
|
read += blocksize
|
||||||
|
|
||||||
# totalsize excludes read_start
|
# totalsize excludes read_start
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ def make_json_api_func(host: str, port: int):
|
|||||||
port = port
|
port = port
|
||||||
|
|
||||||
def api_func(path=None, json_data=None, timeout=300):
|
def api_func(path=None, json_data=None, timeout=300):
|
||||||
nonlocal host, port
|
|
||||||
url = f"http://{host}:{port}/json"
|
url = f"http://{host}:{port}/json"
|
||||||
if path is not None:
|
if path is not None:
|
||||||
url += "/" + path
|
url += "/" + path
|
||||||
@@ -765,7 +764,7 @@ def prune_script_state(now, args, config, script_state):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global read_json_api, read_json_api_wallet, coins_map
|
global read_json_api, read_json_api_wallet
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-v",
|
"-v",
|
||||||
|
|||||||
@@ -357,7 +357,6 @@ def make_rpc_func(node_id, base_rpc_port=BASE_RPC_PORT):
|
|||||||
auth = "test{0}:test_pass{0}".format(node_id)
|
auth = "test{0}:test_pass{0}".format(node_id)
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet=None):
|
def rpc_func(method, params=None, wallet=None):
|
||||||
nonlocal node_id, auth
|
|
||||||
return callrpc(base_rpc_port + node_id, auth, method, params, wallet)
|
return callrpc(base_rpc_port + node_id, auth, method, params, wallet)
|
||||||
|
|
||||||
return rpc_func
|
return rpc_func
|
||||||
|
|||||||
@@ -277,7 +277,6 @@ def make_part_cli_rpc_func(node_id):
|
|||||||
node_id = node_id
|
node_id = node_id
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet=None):
|
def rpc_func(method, params=None, wallet=None):
|
||||||
nonlocal node_id
|
|
||||||
cmd = method
|
cmd = method
|
||||||
if params:
|
if params:
|
||||||
for p in params:
|
for p in params:
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ def make_rpc_func(node_id, base_rpc_port):
|
|||||||
auth = "test{0}:test_pass{0}".format(node_id)
|
auth = "test{0}:test_pass{0}".format(node_id)
|
||||||
|
|
||||||
def rpc_func(method, params=None):
|
def rpc_func(method, params=None):
|
||||||
nonlocal node_id, auth
|
|
||||||
return callrpc(base_rpc_port + node_id, auth, method, params)
|
return callrpc(base_rpc_port + node_id, auth, method, params)
|
||||||
|
|
||||||
return rpc_func
|
return rpc_func
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ def make_part_cli_rpc_func(node_id):
|
|||||||
node_id = node_id
|
node_id = node_id
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet=None):
|
def rpc_func(method, params=None, wallet=None):
|
||||||
nonlocal node_id
|
|
||||||
cmd = method
|
cmd = method
|
||||||
if params:
|
if params:
|
||||||
for p in params:
|
for p in params:
|
||||||
|
|||||||
@@ -282,7 +282,6 @@ def make_part_cli_rpc_func(node_id):
|
|||||||
node_id = node_id
|
node_id = node_id
|
||||||
|
|
||||||
def rpc_func(method, params=None, wallet=None):
|
def rpc_func(method, params=None, wallet=None):
|
||||||
nonlocal node_id
|
|
||||||
cmd = method
|
cmd = method
|
||||||
if params:
|
if params:
|
||||||
for p in params:
|
for p in params:
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ class Test(BaseTest):
|
|||||||
pi = swap_clients[0].pi(SwapTypes.XMR_SWAP)
|
pi = swap_clients[0].pi(SwapTypes.XMR_SWAP)
|
||||||
|
|
||||||
def wait_for_unspents(delay_event, iterations=20, delay_time=0.5):
|
def wait_for_unspents(delay_event, iterations=20, delay_time=0.5):
|
||||||
nonlocal ci
|
|
||||||
i = 0
|
i = 0
|
||||||
while not delay_event.is_set():
|
while not delay_event.is_set():
|
||||||
unspents = ci.rpc_wallet("listunspentblind")
|
unspents = ci.rpc_wallet("listunspentblind")
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ class Test(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_reload(self):
|
def test_reload(self):
|
||||||
global stop_test
|
|
||||||
processes = []
|
processes = []
|
||||||
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
|
|||||||
Reference in New Issue
Block a user