From 484ad0ca389c35f86aacd1d3b29e05b8a1214068 Mon Sep 17 00:00:00 2001 From: tecnovert <tecnovert@tecnovert.net> Date: Tue, 1 Oct 2024 00:13:04 +0200 Subject: [PATCH] lint: Fix issues. --- basicswap/js_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/basicswap/js_server.py b/basicswap/js_server.py index 94598d7..10c9c99 100644 --- a/basicswap/js_server.py +++ b/basicswap/js_server.py @@ -38,6 +38,7 @@ from .ui.util import ( from .ui.page_offers import postNewOffer from .protocols.xmr_swap_1 import recoverNoScriptTxnWithKey, getChainBSplitKey + def getFormData(post_string: str, is_json: bool): if post_string == '': raise ValueError('No post data') @@ -762,7 +763,8 @@ def js_help(self, url_split, post_string, is_json) -> bytes: for k in pages: commands.append(k) return bytes(json.dumps({'commands': commands}), 'UTF-8') - + + def js_readurl(self, url_split, post_string, is_json) -> bytes: swap_client = self.server.swap_client post_data = {} if post_string == '' else getFormData(post_string, is_json) @@ -783,6 +785,7 @@ def js_readurl(self, url_split, post_string, is_json) -> bytes: return response raise ValueError('Requires URL.') + pages = { 'coins': js_coins, 'wallets': js_wallets, @@ -810,6 +813,7 @@ pages = { 'readurl': js_readurl, } + def js_url_to_function(url_split): if len(url_split) > 2: return pages.get(url_split[2], js_404)