mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
lint: Fix issues.
This commit is contained in:
@@ -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')
|
||||||
@@ -763,6 +764,7 @@ def js_help(self, url_split, post_string, is_json) -> bytes:
|
|||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user