mirror of
https://github.com/basicswap/basicswap.git
synced 2025-02-25 20:40:41 +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 .ui.page_offers import postNewOffer
|
||||||
from .protocols.xmr_swap_1 import recoverNoScriptTxnWithKey, getChainBSplitKey
|
from .protocols.xmr_swap_1 import recoverNoScriptTxnWithKey, getChainBSplitKey
|
||||||
|
|
||||||
|
|
||||||
def getFormData(post_string: str, is_json: bool):
|
def getFormData(post_string: str, is_json: bool):
|
||||||
if post_string == '':
|
if post_string == '':
|
||||||
raise ValueError('No post data')
|
raise ValueError('No post data')
|
||||||
|
@ -762,7 +763,8 @@ def js_help(self, url_split, post_string, is_json) -> bytes:
|
||||||
for k in pages:
|
for k in pages:
|
||||||
commands.append(k)
|
commands.append(k)
|
||||||
return bytes(json.dumps({'commands': commands}), 'UTF-8')
|
return bytes(json.dumps({'commands': commands}), 'UTF-8')
|
||||||
|
|
||||||
|
|
||||||
def js_readurl(self, url_split, post_string, is_json) -> bytes:
|
def js_readurl(self, url_split, post_string, is_json) -> bytes:
|
||||||
swap_client = self.server.swap_client
|
swap_client = self.server.swap_client
|
||||||
post_data = {} if post_string == '' else getFormData(post_string, is_json)
|
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
|
return response
|
||||||
raise ValueError('Requires URL.')
|
raise ValueError('Requires URL.')
|
||||||
|
|
||||||
|
|
||||||
pages = {
|
pages = {
|
||||||
'coins': js_coins,
|
'coins': js_coins,
|
||||||
'wallets': js_wallets,
|
'wallets': js_wallets,
|
||||||
|
@ -810,6 +813,7 @@ pages = {
|
||||||
'readurl': js_readurl,
|
'readurl': js_readurl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def js_url_to_function(url_split):
|
def js_url_to_function(url_split):
|
||||||
if len(url_split) > 2:
|
if len(url_split) > 2:
|
||||||
return pages.get(url_split[2], js_404)
|
return pages.get(url_split[2], js_404)
|
||||||
|
|
Loading…
Reference in a new issue