use relative imports wherever possible
This commit is contained in:
parent
a5766aae1d
commit
66f318b4ef
29 changed files with 51 additions and 54 deletions
|
|
@ -405,8 +405,8 @@ class AddrList(MMGenObject): # Address info for a single seed ID
|
|||
@property
|
||||
def file(self):
|
||||
if not hasattr(self,'_file'):
|
||||
import mmgen.addrfile as mod
|
||||
self._file = getattr( mod, type(self).__name__.replace('List','File') )(self)
|
||||
from . import addrfile
|
||||
self._file = getattr( addrfile, type(self).__name__.replace('List','File') )(self)
|
||||
return self._file
|
||||
|
||||
class KeyAddrList(AddrList):
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ class Config(Lockable):
|
|||
assert cfg is None, (
|
||||
'Config(): ‘cfg’ cannot be used simultaneously with ' +
|
||||
'‘opts_data’, ‘parsed_opts’ or ‘process_opts’' )
|
||||
from mmgen.opts import UserOpts
|
||||
from .opts import UserOpts
|
||||
UserOpts(
|
||||
cfg = self,
|
||||
opts_data = opts_data,
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ devtools_funcs = {
|
|||
}
|
||||
|
||||
def devtools_call(funcname,*args,**kwargs):
|
||||
import mmgen.devtools
|
||||
return getattr(mmgen.devtools,funcname)(*args,**kwargs)
|
||||
from . import devtools
|
||||
return getattr(devtools,funcname)(*args,**kwargs)
|
||||
|
||||
def MMGenObject_call(methodname,*args,**kwargs):
|
||||
from .devtools import MMGenObjectMethods
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ def launch(mod,package='mmgen'):
|
|||
errmsg = repr(e.args[0])
|
||||
|
||||
from collections import namedtuple
|
||||
from mmgen.color import nocolor,yellow,red
|
||||
from .color import nocolor,yellow,red
|
||||
|
||||
_o = namedtuple('exit_data',['color','exit_val','fs'])
|
||||
d = {
|
||||
|
|
@ -76,6 +76,6 @@ def launch(mod,package='mmgen'):
|
|||
|
||||
except SystemExit as e:
|
||||
if os.getenv('MMGEN_EXEC_WRAPPER') and e.code != 0:
|
||||
from mmgen.color import red
|
||||
from .color import red
|
||||
sys.stdout.write(red(f'{type(e).__name__}: {e}\n'))
|
||||
raise
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ mmgen-addrgen: Generate a series or range of addresses from an MMGen
|
|||
deterministic wallet
|
||||
"""
|
||||
|
||||
import mmgen.addrlist
|
||||
|
||||
from . import addrlist
|
||||
from .cfg import gc,Config
|
||||
from .addr import MMGenAddrType
|
||||
from .wallet import Wallet
|
||||
|
|
@ -141,7 +140,7 @@ if cfg.keygen_backend:
|
|||
from .keygen import check_backend
|
||||
check_backend( cfg, proto, cfg.keygen_backend, cfg.type )
|
||||
|
||||
idxs = mmgen.addrlist.AddrIdxList( fmt_str=cfg._args.pop() )
|
||||
idxs = addrlist.AddrIdxList( fmt_str=cfg._args.pop() )
|
||||
|
||||
from .fileutil import get_seed_file
|
||||
sf = get_seed_file(cfg,1)
|
||||
|
|
@ -158,7 +157,7 @@ if cfg.no_addresses:
|
|||
elif cfg.viewkeys:
|
||||
gen_clsname = 'ViewKeyAddrList'
|
||||
|
||||
al = getattr( mmgen.addrlist, gen_clsname )(
|
||||
al = getattr( addrlist, gen_clsname )(
|
||||
cfg = cfg,
|
||||
proto = proto,
|
||||
seed = ss_seed,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ objmethods: Mixin classes for MMGen data objects
|
|||
"""
|
||||
|
||||
import unicodedata
|
||||
import mmgen.color as color_mod
|
||||
from . import color as color_mod
|
||||
|
||||
if 'MMGenObjectDevTools' in __builtins__: # added to builtins by devinit.init_dev()
|
||||
MMGenObject = __builtins__['MMGenObjectDevTools']
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ proto.btc.tx.base: Bitcoin base transaction class
|
|||
|
||||
from collections import namedtuple
|
||||
|
||||
import mmgen.tx.base as TxBase
|
||||
from ....tx import base as TxBase
|
||||
from ....obj import MMGenList,HexStr
|
||||
from ....util import msg,make_chksum_6,die,pp_fmt
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
proto.btc.tx.bump: Bitcoin transaction bump class
|
||||
"""
|
||||
|
||||
import mmgen.tx.bump as TxBase
|
||||
from ....tx import bump as TxBase
|
||||
from ....util import msg
|
||||
from .new import New
|
||||
from .completed import Completed
|
||||
from ....util import msg
|
||||
|
||||
class Bump(Completed,New,TxBase.Bump):
|
||||
desc = 'fee-bumped transaction'
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
proto.btc.tx.completed: Bitcoin completed transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.completed as TxBase
|
||||
from .base import Base,scriptPubKey2addr
|
||||
from ....tx import completed as TxBase
|
||||
from ....obj import HexStr
|
||||
from ....util import msg,die
|
||||
from .base import Base,scriptPubKey2addr
|
||||
|
||||
class Completed(Base,TxBase.Completed):
|
||||
fn_fee_unit = 'satoshi'
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
proto.btc.tx.new: Bitcoin new transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.new as TxBase
|
||||
from .base import Base
|
||||
from ....tx import new as TxBase
|
||||
from ....obj import MMGenTxID
|
||||
from ....util import msg,fmt,make_chksum_6,die
|
||||
from .base import Base
|
||||
|
||||
class New(Base,TxBase.New):
|
||||
usr_fee_prompt = 'Enter transaction fee: '
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ proto.btc.tx.online: Bitcoin online signed transaction class
|
|||
|
||||
import sys
|
||||
|
||||
import mmgen.tx.online as TxBase
|
||||
from .signed import Signed
|
||||
from ....tx import online as TxBase
|
||||
from ....util import msg,ymsg,rmsg,die
|
||||
from .signed import Signed
|
||||
|
||||
class OnlineSigned(Signed,TxBase.OnlineSigned):
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
proto.btc.tx.signed: Bitcoin signed transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.signed as TxBase
|
||||
from .completed import Completed
|
||||
from ....tx import signed as TxBase
|
||||
from ....util import fmt,die
|
||||
from .completed import Completed
|
||||
|
||||
class Signed(Completed,TxBase.Signed):
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ proto.btc.tx.status: Bitcoin transaction status class
|
|||
|
||||
import time
|
||||
|
||||
import mmgen.tx.status as TxBase
|
||||
from ....tx import status as TxBase
|
||||
from ....util import msg,suf,die,secs_to_dhms
|
||||
|
||||
class Status(TxBase.Status):
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
proto.btc.tx.unsigned: Bitcoin unsigned transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.unsigned as TxBase
|
||||
from .completed import Completed
|
||||
from ....tx import unsigned as TxBase
|
||||
from ....obj import CoinTxID,MMGenDict
|
||||
from ....util import msg,msg_r,ymsg,suf,die
|
||||
from .completed import Completed
|
||||
|
||||
class Unsigned(Completed,TxBase.Unsigned):
|
||||
desc = 'unsigned transaction'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ proto.eth.tx.base: Ethereum base transaction class
|
|||
|
||||
from collections import namedtuple
|
||||
|
||||
import mmgen.tx.base as TxBase
|
||||
from ....tx import base as TxBase
|
||||
from ....obj import HexStr,Int
|
||||
|
||||
class Base(TxBase.Base):
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ proto.eth.tx.bump: Ethereum transaction bump class
|
|||
|
||||
from decimal import Decimal
|
||||
|
||||
import mmgen.tx.bump as TxBase
|
||||
from ....tx import bump as TxBase
|
||||
from .completed import Completed,TokenCompleted
|
||||
from .new import New,TokenNew
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
proto.eth.tx.completed: Ethereum completed transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.completed as TxBase
|
||||
from ....tx import completed as TxBase
|
||||
from .base import Base,TokenBase
|
||||
|
||||
class Completed(Base,TxBase.Completed):
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ proto.eth.tx.new: Ethereum new transaction class
|
|||
|
||||
import json
|
||||
|
||||
import mmgen.tx.new as TxBase
|
||||
from .base import Base,TokenBase
|
||||
from ....tx import new as TxBase
|
||||
from ....obj import Int,ETHNonce,MMGenTxID,Str,HexStr
|
||||
from ....util import msg,is_int,is_hex_str,make_chksum_6,suf,die
|
||||
from ....tw.ctl import TwCtl
|
||||
from ....addr import is_mmgen_id,is_coin_addr
|
||||
from ..contract import Token
|
||||
from .base import Base,TokenBase
|
||||
|
||||
class New(Base,TxBase.New):
|
||||
desc = 'transaction'
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
proto.eth.tx.online: Ethereum online signed transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.online as TxBase
|
||||
from .signed import Signed,TokenSigned
|
||||
from .. import erigon_sleep
|
||||
from ....util import msg,rmsg,die
|
||||
from ....tx import online as TxBase
|
||||
from .. import erigon_sleep
|
||||
from .signed import Signed,TokenSigned
|
||||
|
||||
class OnlineSigned(Signed,TxBase.OnlineSigned):
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
proto.eth.tx.signed: Ethereum signed transaction class
|
||||
"""
|
||||
|
||||
import mmgen.tx.signed as TxBase
|
||||
from .completed import Completed,TokenCompleted
|
||||
from ....tx import signed as TxBase
|
||||
from ....obj import Str,CoinTxID,ETHNonce,HexStr
|
||||
from ....addr import CoinAddr,TokenAddr
|
||||
from .completed import Completed,TokenCompleted
|
||||
|
||||
class Signed(Completed,TxBase.Signed):
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue