mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-30 22:35:53 +00:00
lint: Fix issues.
This commit is contained in:
parent
ac7f24daff
commit
484ad0ca38
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue