mirror of
https://github.com/basicswap/basicswap.git
synced 2025-04-06 14:27:30 +00:00
lint: Changes for flake8 7.2
This commit is contained in:
parent
447f32d6b2
commit
a0c31fb87d
12 changed files with 2 additions and 15 deletions
basicswap
scripts
tests/basicswap
|
@ -42,7 +42,6 @@ def make_rpc_func(port, auth, host="127.0.0.1"):
|
|||
host = host
|
||||
|
||||
def rpc_func(method, params=None):
|
||||
nonlocal port, auth, host
|
||||
return callrpc(port, auth, method, params, host)
|
||||
|
||||
return rpc_func
|
||||
|
|
|
@ -159,7 +159,6 @@ def make_rpc_func(port, auth, wallet=None, host="127.0.0.1"):
|
|||
host = host
|
||||
|
||||
def rpc_func(method, params=None, wallet_override=None):
|
||||
nonlocal port, auth, wallet, host
|
||||
return callrpc(
|
||||
port,
|
||||
auth,
|
||||
|
|
|
@ -309,7 +309,6 @@ def make_xmr_rpc2_func(
|
|||
transport.set_proxy(proxy_host, proxy_port)
|
||||
|
||||
def rpc_func(method, params=None, wallet=None, timeout=default_timeout):
|
||||
nonlocal port, auth, host, transport, tag
|
||||
return callrpc_xmr2(
|
||||
port,
|
||||
method,
|
||||
|
@ -345,7 +344,6 @@ def make_xmr_rpc_func(
|
|||
transport.set_proxy(proxy_host, proxy_port)
|
||||
|
||||
def rpc_func(method, params=None, wallet=None, timeout=default_timeout):
|
||||
nonlocal port, auth, host, transport, tag
|
||||
return callrpc_xmr(
|
||||
port,
|
||||
method,
|
||||
|
|
|
@ -38,8 +38,7 @@ def make_reporthook(read_start: int, logger):
|
|||
logger.info(f"Attempting to resume from byte {read_start}")
|
||||
|
||||
def reporthook(blocknum, blocksize, totalsize):
|
||||
nonlocal read, last_percent_str, time_last, read_last, display_last, read_start
|
||||
nonlocal average_buffer, abo, logger
|
||||
nonlocal read, last_percent_str, time_last, read_last, display_last, abo
|
||||
read += blocksize
|
||||
|
||||
# totalsize excludes read_start
|
||||
|
|
|
@ -101,7 +101,6 @@ def make_json_api_func(host: str, port: int):
|
|||
port = port
|
||||
|
||||
def api_func(path=None, json_data=None, timeout=300):
|
||||
nonlocal host, port
|
||||
url = f"http://{host}:{port}/json"
|
||||
if path is not None:
|
||||
url += "/" + path
|
||||
|
@ -765,7 +764,7 @@ def prune_script_state(now, args, config, script_state):
|
|||
|
||||
|
||||
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.add_argument(
|
||||
"-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)
|
||||
|
||||
def rpc_func(method, params=None, wallet=None):
|
||||
nonlocal node_id, auth
|
||||
return callrpc(base_rpc_port + node_id, auth, method, params, wallet)
|
||||
|
||||
return rpc_func
|
||||
|
|
|
@ -277,7 +277,6 @@ def make_part_cli_rpc_func(node_id):
|
|||
node_id = node_id
|
||||
|
||||
def rpc_func(method, params=None, wallet=None):
|
||||
nonlocal node_id
|
||||
cmd = method
|
||||
if 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)
|
||||
|
||||
def rpc_func(method, params=None):
|
||||
nonlocal node_id, auth
|
||||
return callrpc(base_rpc_port + node_id, auth, method, params)
|
||||
|
||||
return rpc_func
|
||||
|
|
|
@ -257,7 +257,6 @@ def make_part_cli_rpc_func(node_id):
|
|||
node_id = node_id
|
||||
|
||||
def rpc_func(method, params=None, wallet=None):
|
||||
nonlocal node_id
|
||||
cmd = method
|
||||
if params:
|
||||
for p in params:
|
||||
|
|
|
@ -282,7 +282,6 @@ def make_part_cli_rpc_func(node_id):
|
|||
node_id = node_id
|
||||
|
||||
def rpc_func(method, params=None, wallet=None):
|
||||
nonlocal node_id
|
||||
cmd = method
|
||||
if params:
|
||||
for p in params:
|
||||
|
|
|
@ -113,7 +113,6 @@ class Test(BaseTest):
|
|||
pi = swap_clients[0].pi(SwapTypes.XMR_SWAP)
|
||||
|
||||
def wait_for_unspents(delay_event, iterations=20, delay_time=0.5):
|
||||
nonlocal ci
|
||||
i = 0
|
||||
while not delay_event.is_set():
|
||||
unspents = ci.rpc_wallet("listunspentblind")
|
||||
|
|
|
@ -111,7 +111,6 @@ class Test(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_reload(self):
|
||||
global stop_test
|
||||
processes = []
|
||||
|
||||
for i in range(3):
|
||||
|
|
Loading…
Reference in a new issue