From 4f422338365327674c8f272ac997901c70b736b6 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 11 Oct 2023 12:58:48 +0000 Subject: [PATCH] pylint throughout (excluding tests) - imports --- mmgen/addrdata.py | 1 - mmgen/addrlist.py | 6 ++++-- mmgen/altcoin.py | 2 +- mmgen/autosign.py | 5 +---- mmgen/daemon.py | 2 +- mmgen/led.py | 2 -- mmgen/msg.py | 2 +- mmgen/obj.py | 2 +- mmgen/opts.py | 4 +--- mmgen/proto/btc/params.py | 4 ++-- mmgen/proto/btc/tw/addresses.py | 3 +-- mmgen/proto/btc/tw/rpc.py | 1 - mmgen/proto/btc/tw/unspent.py | 1 - mmgen/proto/btc/tx/base.py | 2 +- mmgen/proto/btc/tx/new.py | 2 +- mmgen/proto/btc/tx/online.py | 2 ++ mmgen/proto/btc/tx/unsigned.py | 3 ++- mmgen/proto/eth/tw/addresses.py | 2 -- mmgen/proto/eth/tw/rpc.py | 1 - mmgen/proto/eth/tx/bump.py | 3 ++- mmgen/proto/eth/tx/online.py | 1 + mmgen/proto/eth/tx/signed.py | 1 - mmgen/proto/eth/tx/unsigned.py | 3 ++- mmgen/proto/zec/params.py | 3 +-- mmgen/term.py | 1 - mmgen/tool/help.py | 3 ++- mmgen/tool/rpc.py | 1 - mmgen/tw/addresses.py | 1 - mmgen/tw/bal.py | 2 -- mmgen/tw/txhistory.py | 1 - mmgen/tw/unspent.py | 1 - mmgen/tw/view.py | 2 +- mmgen/tx/info.py | 4 ++-- mmgen/tx/new.py | 1 + mmgen/ui.py | 1 - mmgen/util2.py | 2 +- mmgen/wallet/base.py | 2 +- mmgen/xmrwallet.py | 2 +- scripts/uninstall-mmgen.py | 2 +- setup.py | 4 ++-- 40 files changed, 37 insertions(+), 51 deletions(-) diff --git a/mmgen/addrdata.py b/mmgen/addrdata.py index 32121cd4..2256446f 100755 --- a/mmgen/addrdata.py +++ b/mmgen/addrdata.py @@ -54,7 +54,6 @@ class AddrData(MMGenObject): return (list(d.values())[0][0]) if d else None def add(self,addrlist): - from .addrlist import AddrList if type(addrlist) == AddrList: self.al_ids[addrlist.al_id] = addrlist return True diff --git a/mmgen/addrlist.py b/mmgen/addrlist.py index 98a6109c..f4cdc216 100755 --- a/mmgen/addrlist.py +++ b/mmgen/addrlist.py @@ -251,7 +251,8 @@ class AddrList(MMGenObject): # Address info for a single seed ID gen_viewkey = type(self) in (KeyAddrList,ViewKeyAddrList) and 'viewkey' in mmtype.extra_attrs if self.gen_addrs: - from .addrgen import KeyGenerator,AddrGenerator + from .keygen import KeyGenerator + from .addrgen import AddrGenerator kg = KeyGenerator( self.cfg, self.proto, mmtype.pubkey_type ) ag = AddrGenerator( self.cfg, self.proto, mmtype ) if self.add_p2pkh: @@ -377,7 +378,8 @@ class AddrList(MMGenObject): # Address info for a single seed ID """ def gen_addr(pk,t): at = self.proto.addr_type(t) - from .addrgen import KeyGenerator,AddrGenerator + from .keygen import KeyGenerator + from .addrgen import AddrGenerator kg = KeyGenerator( self.cfg, self.proto, at.pubkey_type ) ag = AddrGenerator( self.cfg, self.proto, at ) return ag.to_addr(kg.gen_data(pk)) diff --git a/mmgen/altcoin.py b/mmgen/altcoin.py index 8e454a3c..b9828927 100755 --- a/mmgen/altcoin.py +++ b/mmgen/altcoin.py @@ -36,6 +36,7 @@ altcoin.py - Coin constants for Bitcoin-derived altcoins # NBT: 150/191 c/u, 25/('B'), 26/('B') import sys +from collections import namedtuple from .cfg import gc,Config from .util import msg @@ -57,7 +58,6 @@ def test_equal(desc,a,b,*cdata): b_desc, b )) -from collections import namedtuple ce = namedtuple('CoinInfoEntry', ['name','symbol','wif_ver_num','p2pkh_info','p2sh_info','has_segwit','trust_level']) diff --git a/mmgen/autosign.py b/mmgen/autosign.py index 8c634209..211d12c0 100755 --- a/mmgen/autosign.py +++ b/mmgen/autosign.py @@ -14,8 +14,7 @@ autosign: Auto-sign MMGen transactions, message files and XMR wallet output file import sys,os,asyncio from pathlib import Path -from subprocess import run,PIPE,DEVNULL -from collections import namedtuple +from subprocess import run,DEVNULL from .cfg import Config from .util import msg,msg_r,ymsg,rmsg,gmsg,bmsg,die,suf,fmt,fmt_list,async_run @@ -487,7 +486,6 @@ class Autosign: cfg = self.cfg, prompt = f"Default wallet '{wf}' found.\nUse default wallet for autosigning?", default_yes = True ): - from .cfg import Config ss_in = Wallet( Config(), wf ) else: ss_in = Wallet( self.cfg, in_fmt=self.mn_fmts[self.cfg.mnemonic_fmt or self.dfl_mn_fmt] ) @@ -497,7 +495,6 @@ class Autosign: @property def xmrwallet_cfg(self): if not hasattr(self,'_xmrwallet_cfg'): - from .cfg import Config self._xmrwallet_cfg = Config({ '_clone': self.cfg, 'coin': 'xmr', diff --git a/mmgen/daemon.py b/mmgen/daemon.py index ea9bbf6a..957ba24d 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -27,7 +27,7 @@ from collections import namedtuple from .cfg import gc from .base_obj import Lockable from .color import set_vt100 -from .util import msg,Msg_r,ymsg,die,remove_dups,oneshot_warning,fmt_list +from .util import msg,Msg_r,die,remove_dups,oneshot_warning,fmt_list from .flags import ClassFlags,ClassOpts _dd = namedtuple('daemon_data',['coind_name','coind_version','coind_version_str']) # latest tested version diff --git a/mmgen/led.py b/mmgen/led.py index 24273528..4fb02084 100755 --- a/mmgen/led.py +++ b/mmgen/led.py @@ -73,7 +73,6 @@ class LEDControl: else: break else: - from .util import die die( 'NoLEDSupport', 'Control files not found! LED control not supported on this system' ) msg(f'{board.name} board detected') @@ -93,7 +92,6 @@ class LEDControl: fp.write(f'{init_val}\n') return True except PermissionError: - from .util import die die(2,'\n'+fmt(f""" You do not have access to the {desc} file To allow access, run the following command: diff --git a/mmgen/msg.py b/mmgen/msg.py index 5a63bf2d..aa2fece9 100755 --- a/mmgen/msg.py +++ b/mmgen/msg.py @@ -15,7 +15,7 @@ msg: base message signing classes import os,importlib,json from .cfg import gc from .objmethods import MMGenObject,Hilite,InitErrors -from .util import msg,die,suf,make_chksum_6,fmt_list,remove_dups +from .util import msg,die,make_chksum_6,fmt_list,remove_dups from .color import red,orange,grnbg from .protocol import init_proto from .fileutil import get_data_from_file,write_data_to_file diff --git a/mmgen/obj.py b/mmgen/obj.py index 96996346..fc627d15 100755 --- a/mmgen/obj.py +++ b/mmgen/obj.py @@ -20,7 +20,7 @@ obj: MMGen native classes """ -import sys,os,re,unicodedata +import unicodedata from .objmethods import MMGenObject,Hilite,InitErrors diff --git a/mmgen/opts.py b/mmgen/opts.py index 5b35e4aa..f36c2419 100755 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -21,10 +21,9 @@ opts: MMGen-specific command-line options processing after generic processing by """ import sys,os +from .share import Opts from .cfg import gc -import mmgen.share.Opts as Opts - def opt_preproc_debug(po): d = ( ('Cmdline', ' '.join(sys.argv), False), @@ -34,7 +33,6 @@ def opt_preproc_debug(po): ('Opts', po.opts, True), ) from .util import Msg,fmt_list - from pprint import pformat Msg('\n=== opts.py debug ===') for label,data,pretty in d: Msg(' {:<20}: {}'.format(label,'\n' + fmt_list(data,fmt='col',indent=' '*8) if pretty else data)) diff --git a/mmgen/proto/btc/params.py b/mmgen/proto/btc/params.py index a83959b8..f5912b5f 100755 --- a/mmgen/proto/btc/params.py +++ b/mmgen/proto/btc/params.py @@ -78,7 +78,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp def decode_addr(self,addr): if 'B' in self.mmtypes and addr[:len(self.bech32_hrp)] == self.bech32_hrp: - import mmgen.contrib.bech32 as bech32 + from ...contrib import bech32 ret = bech32.decode(self.bech32_hrp,addr) if ret[0] != self.witness_vernum: @@ -109,7 +109,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp p2sh = True ) def pubhash2bech32addr(self,pubhash): - import mmgen.contrib.bech32 as bech32 + from ...contrib import bech32 return bech32.bech32_encode( hrp = self.bech32_hrp, data = [self.witness_vernum] + bech32.convertbits(list(pubhash),8,5) ) diff --git a/mmgen/proto/btc/tw/addresses.py b/mmgen/proto/btc/tw/addresses.py index a78fe36f..a26cade1 100755 --- a/mmgen/proto/btc/tw/addresses.py +++ b/mmgen/proto/btc/tw/addresses.py @@ -15,8 +15,7 @@ proto.btc.tw.addresses: Bitcoin base protocol tracking wallet address list class from ....tw.addresses import TwAddresses from ....tw.shared import TwLabel from ....util import msg,msg_r -from ....addr import CoinAddr -from ....obj import NonNegativeInt,get_obj +from ....obj import get_obj from .rpc import BitcoinTwRPC class BitcoinTwAddresses(TwAddresses,BitcoinTwRPC): diff --git a/mmgen/proto/btc/tw/rpc.py b/mmgen/proto/btc/tw/rpc.py index b5f8fb48..50458e93 100755 --- a/mmgen/proto/btc/tw/rpc.py +++ b/mmgen/proto/btc/tw/rpc.py @@ -14,7 +14,6 @@ proto.btc.tw.rpc: Bitcoin base protocol tracking wallet RPC classes from ....addr import CoinAddr from ....util import die,msg,rmsg -from ....obj import MMGenList from ....tw.shared import get_tw_label from ....tw.rpc import TwRPC diff --git a/mmgen/proto/btc/tw/unspent.py b/mmgen/proto/btc/tw/unspent.py index 08a32f2b..b03b56e3 100755 --- a/mmgen/proto/btc/tw/unspent.py +++ b/mmgen/proto/btc/tw/unspent.py @@ -13,7 +13,6 @@ proto.btc.tw.unspent: Bitcoin base protocol tracking wallet unspent outputs clas """ from ....tw.unspent import TwUnspentOutputs -from ....addr import CoinAddr class BitcoinTwUnspentOutputs(TwUnspentOutputs): diff --git a/mmgen/proto/btc/tx/base.py b/mmgen/proto/btc/tx/base.py index 185c4f4d..75e8a977 100755 --- a/mmgen/proto/btc/tx/base.py +++ b/mmgen/proto/btc/tx/base.py @@ -15,7 +15,7 @@ proto.btc.tx.base: Bitcoin base transaction class from collections import namedtuple import mmgen.tx.base as TxBase -from ....obj import MMGenObject,MMGenList,HexStr +from ....obj import MMGenList,HexStr from ....util import msg,make_chksum_6,die,pp_fmt def addr2scriptPubKey(proto,addr): diff --git a/mmgen/proto/btc/tx/new.py b/mmgen/proto/btc/tx/new.py index cb6e059c..6d908788 100755 --- a/mmgen/proto/btc/tx/new.py +++ b/mmgen/proto/btc/tx/new.py @@ -14,7 +14,7 @@ proto.btc.tx.new: Bitcoin new transaction class import mmgen.tx.new as TxBase from .base import Base -from ....obj import HexStr,MMGenTxID +from ....obj import MMGenTxID from ....util import msg,fmt,make_chksum_6,die class New(Base,TxBase.New): diff --git a/mmgen/proto/btc/tx/online.py b/mmgen/proto/btc/tx/online.py index 41d79acd..06cd5600 100755 --- a/mmgen/proto/btc/tx/online.py +++ b/mmgen/proto/btc/tx/online.py @@ -12,6 +12,8 @@ proto.btc.tx.online: Bitcoin online signed transaction class """ +import sys + import mmgen.tx.online as TxBase from .signed import Signed from ....util import msg,ymsg,rmsg,die diff --git a/mmgen/proto/btc/tx/unsigned.py b/mmgen/proto/btc/tx/unsigned.py index e8a41f23..8454c863 100755 --- a/mmgen/proto/btc/tx/unsigned.py +++ b/mmgen/proto/btc/tx/unsigned.py @@ -14,7 +14,7 @@ proto.btc.tx.unsigned: Bitcoin unsigned transaction class import mmgen.tx.unsigned as TxBase from .completed import Completed -from ....obj import HexStr,CoinTxID,MMGenDict +from ....obj import CoinTxID,MMGenDict from ....util import msg,msg_r,ymsg,suf,die class Unsigned(Completed,TxBase.Unsigned): @@ -22,6 +22,7 @@ class Unsigned(Completed,TxBase.Unsigned): async def sign(self,tx_num_str,keys): # return signed object or False; don't exit or raise exception + from ....exception import TransactionChainMismatch try: self.check_correct_chain() except TransactionChainMismatch: diff --git a/mmgen/proto/eth/tw/addresses.py b/mmgen/proto/eth/tw/addresses.py index 769118df..d147700c 100755 --- a/mmgen/proto/eth/tw/addresses.py +++ b/mmgen/proto/eth/tw/addresses.py @@ -13,8 +13,6 @@ proto.eth.tw.addresses: Ethereum base protocol tracking wallet address list clas """ from ....tw.addresses import TwAddresses -from ....tw.ctl import TwCtl -from ....addr import CoinAddr from .view import EthereumTwView from .rpc import EthereumTwRPC diff --git a/mmgen/proto/eth/tw/rpc.py b/mmgen/proto/eth/tw/rpc.py index aee810f3..6c8db7a9 100755 --- a/mmgen/proto/eth/tw/rpc.py +++ b/mmgen/proto/eth/tw/rpc.py @@ -12,7 +12,6 @@ proto.eth.tw.rpc: Ethereum base protocol tracking wallet RPC class """ -from ....tw.ctl import TwCtl from ....addr import CoinAddr from ....tw.shared import TwLabel from ....tw.rpc import TwRPC diff --git a/mmgen/proto/eth/tx/bump.py b/mmgen/proto/eth/tx/bump.py index 2fb89a6a..944600a5 100755 --- a/mmgen/proto/eth/tx/bump.py +++ b/mmgen/proto/eth/tx/bump.py @@ -12,10 +12,11 @@ proto.eth.tx.bump: Ethereum transaction bump class """ +from decimal import Decimal + import mmgen.tx.bump as TxBase from .completed import Completed,TokenCompleted from .new import New,TokenNew -from decimal import Decimal class Bump(Completed,New,TxBase.Bump): desc = 'fee-bumped transaction' diff --git a/mmgen/proto/eth/tx/online.py b/mmgen/proto/eth/tx/online.py index dd5ac179..f0875371 100755 --- a/mmgen/proto/eth/tx/online.py +++ b/mmgen/proto/eth/tx/online.py @@ -47,6 +47,7 @@ class OnlineSigned(Signed,TxBase.OnlineSigned): if ret is False: # TODO: unreachable code rmsg(f'Send of MMGen transaction {self.txid} failed') if exit_on_fail: + import sys sys.exit(1) return False else: diff --git a/mmgen/proto/eth/tx/signed.py b/mmgen/proto/eth/tx/signed.py index 7002341e..d823038e 100755 --- a/mmgen/proto/eth/tx/signed.py +++ b/mmgen/proto/eth/tx/signed.py @@ -14,7 +14,6 @@ proto.eth.tx.signed: Ethereum signed transaction class import mmgen.tx.signed as TxBase from .completed import Completed,TokenCompleted -from ..contract import Token from ....obj import Str,CoinTxID,ETHNonce,HexStr from ....addr import CoinAddr,TokenAddr diff --git a/mmgen/proto/eth/tx/unsigned.py b/mmgen/proto/eth/tx/unsigned.py index dbb5f058..a9705d22 100755 --- a/mmgen/proto/eth/tx/unsigned.py +++ b/mmgen/proto/eth/tx/unsigned.py @@ -17,7 +17,7 @@ import json import mmgen.tx.unsigned as TxBase from .completed import Completed,TokenCompleted from ..contract import Token -from ....util import msg,msg_r,ymsg +from ....util import msg,msg_r from ....obj import Str,CoinTxID,ETHNonce,Int,HexStr from ....addr import CoinAddr,TokenAddr @@ -68,6 +68,7 @@ class Unsigned(Completed,TxBase.Unsigned): async def sign(self,tx_num_str,keys): # return TX object or False; don't exit or raise exception + from ....exception import TransactionChainMismatch try: self.check_correct_chain() except TransactionChainMismatch: diff --git a/mmgen/proto/zec/params.py b/mmgen/proto/zec/params.py index 6f1575e5..c935d64a 100755 --- a/mmgen/proto/zec/params.py +++ b/mmgen/proto/zec/params.py @@ -13,8 +13,7 @@ proto.zec.params: Zcash protocol """ from ..btc.params import mainnet -from ..btc.common import b58chk_decode -from ...protocol import decoded_wif,decoded_addr +from ...protocol import decoded_addr from ...addr import CoinAddr class ZcashViewKey(CoinAddr): diff --git a/mmgen/term.py b/mmgen/term.py index 57fac4d8..a2b3fbf8 100755 --- a/mmgen/term.py +++ b/mmgen/term.py @@ -25,7 +25,6 @@ term: Terminal classes for the MMGen suite import sys,os,time from collections import namedtuple -from .cfg import gc from .util import msg,msg_r,die try: diff --git a/mmgen/tool/help.py b/mmgen/tool/help.py index ae464fc5..d5768374 100755 --- a/mmgen/tool/help.py +++ b/mmgen/tool/help.py @@ -20,8 +20,9 @@ tool.help: Help screen routines for the 'mmgen-tool' utility """ +from mmgen import main_tool + from .common import tool_cmd_base -import mmgen.main_tool as main_tool def main_help(): diff --git a/mmgen/tool/rpc.py b/mmgen/tool/rpc.py index a37c7655..e9a1fb64 100755 --- a/mmgen/tool/rpc.py +++ b/mmgen/tool/rpc.py @@ -178,7 +178,6 @@ class tool_cmd(tool_cmd_base): from ..tw.ctl import TwCtl ret = await (await TwCtl(self.cfg,self.proto,mode='w')).resolve_address( mmgen_or_coin_addr ) if ret: - from ..util import Msg from ..addr import is_coin_addr return ret.twmmid if is_coin_addr(self.proto,mmgen_or_coin_addr) else ret.coinaddr else: diff --git a/mmgen/tw/addresses.py b/mmgen/tw/addresses.py index 2a44fd79..dff76e42 100755 --- a/mmgen/tw/addresses.py +++ b/mmgen/tw/addresses.py @@ -13,7 +13,6 @@ tw.addresses: Tracking wallet listaddresses class for the MMGen suite """ from ..util import msg,suf,is_int -from ..objmethods import MMGenObject from ..obj import MMGenListItem,ImmutableAttr,ListItemAttr,TwComment,NonNegativeInt from ..addr import CoinAddr,MMGenID,MMGenAddrType from ..color import red,green,yellow diff --git a/mmgen/tw/bal.py b/mmgen/tw/bal.py index ea30f8ad..090d34be 100755 --- a/mmgen/tw/bal.py +++ b/mmgen/tw/bal.py @@ -20,8 +20,6 @@ tw.bal: Tracking wallet getbalance class for the MMGen suite """ -from collections import namedtuple - from ..base_obj import AsyncInit from ..objmethods import MMGenObject from ..obj import NonNegativeInt diff --git a/mmgen/tw/txhistory.py b/mmgen/tw/txhistory.py index 19f878dd..80e4a2cf 100755 --- a/mmgen/tw/txhistory.py +++ b/mmgen/tw/txhistory.py @@ -15,7 +15,6 @@ tw.txhistory: Tracking wallet transaction history class for the MMGen suite from collections import namedtuple from ..util import fmt -from ..objmethods import MMGenObject from ..obj import NonNegativeInt from .view import TwView diff --git a/mmgen/tw/unspent.py b/mmgen/tw/unspent.py index 9d0af6c3..1a750037 100755 --- a/mmgen/tw/unspent.py +++ b/mmgen/tw/unspent.py @@ -21,7 +21,6 @@ tw.unspent: Tracking wallet unspent outputs class for the MMGen suite """ from ..util import msg,suf,fmt -from ..objmethods import MMGenObject from ..obj import ( ImmutableAttr, ListItemAttr, diff --git a/mmgen/tw/view.py b/mmgen/tw/view.py index 220809a2..37162d15 100755 --- a/mmgen/tw/view.py +++ b/mmgen/tw/view.py @@ -24,7 +24,7 @@ import sys,time,asyncio from collections import namedtuple from ..cfg import gc,gv -from ..objmethods import Hilite,InitErrors,MMGenObject +from ..objmethods import MMGenObject from ..obj import get_obj,MMGenIdx,MMGenList from ..color import nocolor,yellow,green,red,blue from ..util import msg,msg_r,fmt,die,capfirst,make_timestr diff --git a/mmgen/tx/info.py b/mmgen/tx/info.py index 627944bb..436f1b98 100755 --- a/mmgen/tx/info.py +++ b/mmgen/tx/info.py @@ -12,12 +12,12 @@ tx.info: transaction info class """ +import importlib + from ..cfg import gc from ..color import red,green,orange from ..util import msg,msg_r -import importlib - class TxInfo: def __init__(self,tx): diff --git a/mmgen/tx/new.py b/mmgen/tx/new.py index b522cf10..75912204 100755 --- a/mmgen/tx/new.py +++ b/mmgen/tx/new.py @@ -58,6 +58,7 @@ def mmaddr2coinaddr(cfg,mmaddr,ad_w,ad_f,proto): msg(wmsg('addr_in_addrfile_only')) from ..ui import keypress_confirm if not (cfg.yes or keypress_confirm( cfg, 'Continue anyway?' )): + import sys sys.exit(1) else: die(2,wmsg('addr_not_found')) diff --git a/mmgen/ui.py b/mmgen/ui.py index 76f8f450..95defaa5 100755 --- a/mmgen/ui.py +++ b/mmgen/ui.py @@ -14,7 +14,6 @@ ui: Interactive user interface functions for the MMGen suite import sys,os -from .cfg import gc from .util import msg,msg_r,Msg,die def confirm_or_raise(cfg,message,action,expect='YES',exit_msg='Exiting at user request'): diff --git a/mmgen/util2.py b/mmgen/util2.py index d51dfb9f..b6e7c4b9 100755 --- a/mmgen/util2.py +++ b/mmgen/util2.py @@ -12,7 +12,7 @@ util2: Less frequently-used variables, classes and utility functions for the MMGen suite """ -import re,time +import sys,re,time from .util import msg,suf,hexdigits,die def die_wait(delay,ev=0,s=''): diff --git a/mmgen/wallet/base.py b/mmgen/wallet/base.py index 4a51bba0..6a5b46cf 100755 --- a/mmgen/wallet/base.py +++ b/mmgen/wallet/base.py @@ -16,7 +16,7 @@ import os from ..util import msg,die from ..objmethods import MMGenObject -from . import Wallet,wallet_data,get_wallet_cls +from . import wallet_data,get_wallet_cls class WalletMeta(type): diff --git a/mmgen/xmrwallet.py b/mmgen/xmrwallet.py index 902ce034..977a362f 100755 --- a/mmgen/xmrwallet.py +++ b/mmgen/xmrwallet.py @@ -25,7 +25,7 @@ from collections import namedtuple from pathlib import Path from .objmethods import MMGenObject,Hilite,InitErrors -from .obj import CoinTxID,Int +from .obj import CoinTxID from .color import red,yellow,green,blue,cyan,pink,orange,purple from .util import ( msg, diff --git a/scripts/uninstall-mmgen.py b/scripts/uninstall-mmgen.py index 97338f48..04cc4f43 100755 --- a/scripts/uninstall-mmgen.py +++ b/scripts/uninstall-mmgen.py @@ -18,7 +18,7 @@ import sys,os -import mmgen.opts as opts +from mmgen import opts from mmgen.cfg import gc,Config from mmgen.util import msg,die diff --git a/setup.py b/setup.py index a0953a1d..4fcc6ef4 100755 --- a/setup.py +++ b/setup.py @@ -8,10 +8,10 @@ # https://github.com/mmgen/mmgen # https://gitlab.com/mmgen/mmgen -import sys,os +import os +from subprocess import run,PIPE from setuptools import setup,Extension from setuptools.command.build_ext import build_ext -from subprocess import run,PIPE cache_path = os.path.join(os.environ['HOME'],'.cache','mmgen') ext_path = os.path.join(cache_path,'secp256k1')