lint: Fix issues.

This commit is contained in:
tecnovert 2024-10-01 00:13:04 +02:00
parent ac7f24daff
commit 484ad0ca38
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93

View file

@ -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)