From 4da5945eb36d6d0728cfb1faf6c5c1bba1bfcab0 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 20 Sep 2024 09:36:04 +0000 Subject: [PATCH] pylint: imports --- mmgen/altcoin/params.py | 1 - mmgen/autosign.py | 2 +- mmgen/daemon.py | 1 - mmgen/devtools.py | 2 +- mmgen/led.py | 2 +- mmgen/proto/btc/tw/rpc.py | 2 +- mmgen/tw/unspent.py | 2 +- mmgen/tw/view.py | 2 +- mmgen/util.py | 2 +- mmgen/wallet/base.py | 2 +- mmgen/xmrwallet.py | 3 --- 11 files changed, 8 insertions(+), 13 deletions(-) diff --git a/mmgen/altcoin/params.py b/mmgen/altcoin/params.py index 9ffad53c..94287b0c 100755 --- a/mmgen/altcoin/params.py +++ b/mmgen/altcoin/params.py @@ -27,7 +27,6 @@ altcoin.py - Constants for Bitcoin-derived altcoins # NSR: 149/191 c/u, 63/('S'), 64/('S'|'T') # NBT: 150/191 c/u, 25/('B'), 26/('B') -import sys from collections import namedtuple from ..cfg import gc diff --git a/mmgen/autosign.py b/mmgen/autosign.py index 3a37114e..12732ea2 100755 --- a/mmgen/autosign.py +++ b/mmgen/autosign.py @@ -13,7 +13,7 @@ autosign: Auto-sign MMGen transactions, message files and XMR wallet output file """ import sys, os, asyncio -from stat import S_ISDIR,S_IWUSR,S_IRUSR +from stat import S_IWUSR, S_IRUSR from pathlib import Path from subprocess import run, PIPE, DEVNULL diff --git a/mmgen/daemon.py b/mmgen/daemon.py index ac02a19e..c037a48f 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -24,7 +24,6 @@ import sys,os,time,importlib from subprocess import run,PIPE,CompletedProcess from collections import namedtuple -from .cfg import gc from .base_obj import Lockable from .color import set_vt100 from .util import msg,Msg_r,die,remove_dups,oneshot_warning,fmt_list diff --git a/mmgen/devtools.py b/mmgen/devtools.py index 492bef97..983a9d5c 100755 --- a/mmgen/devtools.py +++ b/mmgen/devtools.py @@ -54,8 +54,8 @@ def Pexit(*args): Pdie(*args,exit_val=0) def print_stack_trace(message=None,fh_list=[],nl='\n',sep='\n ',trim=4): - import os if not fh_list: + import os fh_list.append(open(f'devtools.trace.{os.getpid()}','w')) nl = '' res = get_stack_trace(message,nl,sep,trim) diff --git a/mmgen/led.py b/mmgen/led.py index 96fee2f7..301939bb 100755 --- a/mmgen/led.py +++ b/mmgen/led.py @@ -24,7 +24,7 @@ import sys, os, threading from collections import namedtuple from subprocess import run -from .util import msg, msg_r, fmt, die, have_sudo +from .util import msg, msg_r, die, have_sudo from .color import blue, orange class LEDControl: diff --git a/mmgen/proto/btc/tw/rpc.py b/mmgen/proto/btc/tw/rpc.py index 65945bf6..4ccca953 100755 --- a/mmgen/proto/btc/tw/rpc.py +++ b/mmgen/proto/btc/tw/rpc.py @@ -13,7 +13,7 @@ proto.btc.tw.rpc: Bitcoin base protocol tracking wallet RPC classes """ from ....addr import CoinAddr -from ....util import die,msg,rmsg +from ....util import die, msg from ....tw.shared import get_tw_label from ....tw.rpc import TwRPC from ....tw.ctl import label_addr_pair diff --git a/mmgen/tw/unspent.py b/mmgen/tw/unspent.py index 46f5bfc1..59c51b6c 100755 --- a/mmgen/tw/unspent.py +++ b/mmgen/tw/unspent.py @@ -20,7 +20,7 @@ tw.unspent: Tracking wallet unspent outputs class for the MMGen suite """ -from ..util import msg,suf,fmt +from ..util import msg, suf from ..obj import ( ImmutableAttr, ListItemAttr, diff --git a/mmgen/tw/view.py b/mmgen/tw/view.py index 4aecb2c9..3cb2cef4 100755 --- a/mmgen/tw/view.py +++ b/mmgen/tw/view.py @@ -23,7 +23,7 @@ tw.view: base class for tracking wallet view classes import sys,time,asyncio from collections import namedtuple -from ..cfg import gc,gv +from ..cfg import gv from ..objmethods import MMGenObject from ..obj import get_obj,MMGenIdx,MMGenList from ..color import nocolor,yellow,green,red,blue diff --git a/mmgen/util.py b/mmgen/util.py index 23514916..f23b3e25 100755 --- a/mmgen/util.py +++ b/mmgen/util.py @@ -23,7 +23,7 @@ util: Frequently-used variables, classes and utility functions for the MMGen sui import sys,os,time,re from .color import red,yellow,green,blue,purple -from .cfg import gv,gc +from .cfg import gv ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz' diff --git a/mmgen/wallet/base.py b/mmgen/wallet/base.py index 111e8ed2..93a179ea 100755 --- a/mmgen/wallet/base.py +++ b/mmgen/wallet/base.py @@ -15,7 +15,7 @@ wallet.base: wallet base class import os from ..util import msg,die -from ..color import yellow,orange +from ..color import orange from ..objmethods import MMGenObject from . import wallet_data,get_wallet_cls diff --git a/mmgen/xmrwallet.py b/mmgen/xmrwallet.py index 8f56d6b6..fd034381 100755 --- a/mmgen/xmrwallet.py +++ b/mmgen/xmrwallet.py @@ -42,7 +42,6 @@ from .util import ( async_run, make_timestr, make_chksum_N, - capfirst, list_gen, fmt_dict ) @@ -56,7 +55,6 @@ from .rpc import json_encoder from .proto.xmr.rpc import MoneroRPCClient,MoneroWalletRPCClient from .proto.xmr.daemon import MoneroWalletDaemon from .ui import keypress_confirm -from .autosign import Autosign from .tx.util import get_autosign_obj xmrwallet_uargs = namedtuple('xmrwallet_uargs',[ @@ -816,7 +814,6 @@ class MoneroWalletOps: if not self.asi.device_inserted: die(1,'Removable device not present!') if self.do_umount: - import atexit atexit.register(lambda: self.asi.do_umount()) self.asi.do_mount() self.post_mount_action()