diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 23396f0..d327513 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -1002,8 +1002,10 @@ class BasicSwap(BaseApp): elif c in (Coins.XMR, Coins.WOW): try: ci.ensureWalletExists() - except Exception as e: - self.log.warning("Can't open %s wallet, could be locked.", ci.coin_name()) + except Exception as e: # noqa: F841 + self.log.warning( + "Can't open %s wallet, could be locked.", ci.coin_name() + ) continue elif c == Coins.LTC: ci_mweb = self.ci(Coins.LTC_MWEB) diff --git a/basicswap/interface/part.py b/basicswap/interface/part.py index 5768d32..49caad2 100644 --- a/basicswap/interface/part.py +++ b/basicswap/interface/part.py @@ -172,7 +172,9 @@ class PARTInterface(BTCInterface): elif balance_type == BalanceTypes.BLIND: unspent = self.rpc_wallet("listunspentblind") else: - raise ValueError(f"getUnspentsByAddr not implemented for {balance_type} type") + raise ValueError( + f"getUnspentsByAddr not implemented for {balance_type} type" + ) for u in unspent: if u["spendable"] is not True: continue diff --git a/basicswap/interface/xmr.py b/basicswap/interface/xmr.py index 355cab2..1b0dfc5 100644 --- a/basicswap/interface/xmr.py +++ b/basicswap/interface/xmr.py @@ -114,7 +114,9 @@ class XMRInterface(CoinInterface): log_str: str = "" have_cc_tor_opt = "use_tor" in chain_client_settings if have_cc_tor_opt and chain_client_settings["use_tor"] is False: - log_str = f" bypassing proxy (use_tor false for {self.coin_name()})" + log_str = ( + f" bypassing proxy (use_tor false for {self.coin_name()})" + ) elif have_cc_tor_opt is False and is_private_ip_address(rpchost): log_str = " bypassing proxy (private ip address)" else: @@ -196,7 +198,7 @@ class XMRInterface(CoinInterface): self.rpc_wallet("store") self.rpc_wallet("close_wallet") self._log.debug(f"Attempt to save and close {self.coin_name()} wallet") - except Exception as e: + except Exception as e: # noqa: F841 pass self.rpc_wallet("open_wallet", params) diff --git a/scripts/createoffers.py b/scripts/createoffers.py index 3f8b343..9839e85 100755 --- a/scripts/createoffers.py +++ b/scripts/createoffers.py @@ -375,7 +375,7 @@ def main(): "wallets/{}".format(coin_from_data["ticker"]) ) coin_ticker = coin_from_data["ticker"] - if coin_ticker=="PART" and "variant" in coin_from_data: + if coin_ticker == "PART" and "variant" in coin_from_data: coin_variant = coin_from_data["variant"] if coin_variant == "Anon": coin_from_data_name = "PART_ANON" @@ -384,7 +384,9 @@ def main(): coin_from_data_name = "PART_BLIND" wallet_balance: float = float(wallet_from["blind_balance"]) else: - raise ValueError(f"{coin_ticker} variant {coin_variant} not handled") + raise ValueError( + f"{coin_ticker} variant {coin_variant} not handled" + ) else: coin_from_data_name = coin_ticker wallet_balance: float = float(wallet_from["balance"]) @@ -404,9 +406,7 @@ def main(): None, ): offers_found += 1 - if wallet_balance <= float( - offer_template["min_coin_from_amt"] - ): + if wallet_balance <= float(offer_template["min_coin_from_amt"]): offer_id = offer["offer_id"] print( "Revoking offer {}, wallet from balance below minimum".format( @@ -423,7 +423,7 @@ def main(): min_offer_amount: float = offer_template.get( "amount_step", max_offer_amount ) - + min_wallet_from_amount: float = float( offer_template["min_coin_from_amt"] )