From 5948bd4106cf54f6ad3bbdb6d6092ff3d47fd4c1 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 12 Nov 2022 13:34:40 +0000 Subject: [PATCH] module rename: tw.common -> tw.view --- mmgen/addrdata.py | 2 +- mmgen/main_addrimport.py | 2 +- mmgen/proto/btc/tw/addresses.py | 2 +- mmgen/proto/btc/tw/bal.py | 2 +- mmgen/proto/btc/tw/common.py | 2 +- mmgen/proto/btc/tw/json.py | 2 +- mmgen/proto/btc/tw/txhistory.py | 2 +- mmgen/proto/eth/tw/common.py | 4 ++-- mmgen/proto/eth/tw/json.py | 2 +- mmgen/proto/eth/tw/unspent.py | 2 +- mmgen/tool/rpc.py | 2 +- mmgen/tw/addresses.py | 2 +- mmgen/tw/ctl.py | 2 +- mmgen/tw/txhistory.py | 2 +- mmgen/tw/unspent.py | 2 +- mmgen/tw/{common.py => view.py} | 4 ++-- test/objtest.py | 2 +- test/test_py_d/ts_main.py | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) rename mmgen/tw/{common.py => view.py} (99%) diff --git a/mmgen/addrdata.py b/mmgen/addrdata.py index 8ade8a8b..e8c60e47 100755 --- a/mmgen/addrdata.py +++ b/mmgen/addrdata.py @@ -73,7 +73,7 @@ class TwAddrData(AddrData,metaclass=AsyncInit): async def __init__(self,proto,wallet=None): from .rpc import rpc_init - from .tw.common import TwLabel + from .tw.view import TwLabel from .globalvars import g from .seed import SeedID self.proto = proto diff --git a/mmgen/main_addrimport.py b/mmgen/main_addrimport.py index 8f9e99f5..63ddc5d1 100755 --- a/mmgen/main_addrimport.py +++ b/mmgen/main_addrimport.py @@ -24,7 +24,7 @@ from collections import namedtuple from .common import * from .addrlist import AddrList,KeyAddrList -from .tw.common import TwLabel +from .tw.view import TwLabel opts_data = { 'text': { diff --git a/mmgen/proto/btc/tw/addresses.py b/mmgen/proto/btc/tw/addresses.py index a5aa7e27..c4f5a1ae 100755 --- a/mmgen/proto/btc/tw/addresses.py +++ b/mmgen/proto/btc/tw/addresses.py @@ -13,7 +13,7 @@ proto.btc.tw.addresses: Bitcoin base protocol tracking wallet address list class """ from ....tw.addresses import TwAddresses -from ....tw.common import TwLabel,get_obj +from ....tw.view import TwLabel,get_obj from ....util import msg,msg_r from ....addr import CoinAddr from ....obj import NonNegativeInt diff --git a/mmgen/proto/btc/tw/bal.py b/mmgen/proto/btc/tw/bal.py index 14454fd4..a68fd3bb 100755 --- a/mmgen/proto/btc/tw/bal.py +++ b/mmgen/proto/btc/tw/bal.py @@ -13,7 +13,7 @@ proto.btc.twbal: Bitcoin base protocol tracking wallet balance class """ from ....tw.bal import TwGetBalance -from ....tw.common import get_tw_label +from ....tw.view import get_tw_label class BitcoinTwGetBalance(TwGetBalance): diff --git a/mmgen/proto/btc/tw/common.py b/mmgen/proto/btc/tw/common.py index 587af7d8..106f5fdc 100755 --- a/mmgen/proto/btc/tw/common.py +++ b/mmgen/proto/btc/tw/common.py @@ -15,7 +15,7 @@ proto.btc.tw.common: Bitcoin base protocol tracking wallet dependency classes from ....addr import CoinAddr from ....util import die,msg,rmsg from ....obj import MMGenList -from ....tw.common import get_tw_label +from ....tw.view import get_tw_label class BitcoinTwCommon: diff --git a/mmgen/proto/btc/tw/json.py b/mmgen/proto/btc/tw/json.py index 53208286..a6b7d05f 100755 --- a/mmgen/proto/btc/tw/json.py +++ b/mmgen/proto/btc/tw/json.py @@ -14,7 +14,7 @@ proto.btc.tw.json: export and import tracking wallet to JSON format from collections import namedtuple from ....tw.json import TwJSON -from ....tw.common import TwMMGenID +from ....tw.view import TwMMGenID class BitcoinTwJSON(TwJSON): diff --git a/mmgen/proto/btc/tw/txhistory.py b/mmgen/proto/btc/tw/txhistory.py index daff58be..dc107aa8 100755 --- a/mmgen/proto/btc/tw/txhistory.py +++ b/mmgen/proto/btc/tw/txhistory.py @@ -15,7 +15,7 @@ proto.btc.tw.txhistory: Bitcoin base protocol tracking wallet transaction histor from collections import namedtuple from ....globalvars import g from ....tw.txhistory import TwTxHistory -from ....tw.common import get_tw_label,TwMMGenID +from ....tw.view import get_tw_label,TwMMGenID from ....addr import CoinAddr from ....util import msg,msg_r from ....color import nocolor,red,pink,gray diff --git a/mmgen/proto/eth/tw/common.py b/mmgen/proto/eth/tw/common.py index 8bb59298..58b4a36a 100755 --- a/mmgen/proto/eth/tw/common.py +++ b/mmgen/proto/eth/tw/common.py @@ -13,9 +13,9 @@ proto.eth.tw.common: Ethereum base protocol tracking wallet dependency classes """ from ....globalvars import g from ....tw.ctl import TrackingWallet -from ....tw.common import TwView +from ....tw.view import TwView from ....addr import CoinAddr -from ....tw.common import TwLabel +from ....tw.view import TwLabel class EthereumTwCommon(TwView): diff --git a/mmgen/proto/eth/tw/json.py b/mmgen/proto/eth/tw/json.py index ced80433..c98c6c64 100755 --- a/mmgen/proto/eth/tw/json.py +++ b/mmgen/proto/eth/tw/json.py @@ -14,7 +14,7 @@ proto.eth.tw.json: export and import tracking wallet to JSON format from collections import namedtuple from ....tw.json import TwJSON -from ....tw.common import TwMMGenID +from ....tw.view import TwMMGenID class EthereumTwJSON(TwJSON): diff --git a/mmgen/proto/eth/tw/unspent.py b/mmgen/proto/eth/tw/unspent.py index e3ca48e5..5b1dbf93 100755 --- a/mmgen/proto/eth/tw/unspent.py +++ b/mmgen/proto/eth/tw/unspent.py @@ -20,7 +20,7 @@ proto.eth.twuo: Ethereum tracking wallet unspent outputs class """ -from ....tw.common import TwLabel +from ....tw.view import TwLabel from ....tw.unspent import TwUnspentOutputs from .common import EthereumTwCommon diff --git a/mmgen/tool/rpc.py b/mmgen/tool/rpc.py index f91ffa35..4c704425 100755 --- a/mmgen/tool/rpc.py +++ b/mmgen/tool/rpc.py @@ -21,7 +21,7 @@ tool/rpc.py: JSON/RPC routines for the 'mmgen-tool' utility """ from .common import tool_cmd_base,options_annot_str -from ..tw.common import TwView +from ..tw.view import TwView from ..tw.txhistory import TwTxHistory class tool_cmd(tool_cmd_base): diff --git a/mmgen/tw/addresses.py b/mmgen/tw/addresses.py index ec794934..6ed21b89 100755 --- a/mmgen/tw/addresses.py +++ b/mmgen/tw/addresses.py @@ -19,7 +19,7 @@ from ..obj import MMGenListItem,ImmutableAttr,ListItemAttr,TwComment,NonNegative from ..rpc import rpc_init from ..addr import CoinAddr,MMGenID from ..color import red,green -from .common import TwView,TwMMGenID +from .view import TwView,TwMMGenID class TwAddresses(MMGenObject,TwView,metaclass=AsyncInit): diff --git a/mmgen/tw/ctl.py b/mmgen/tw/ctl.py index 30febc33..89c8a587 100755 --- a/mmgen/tw/ctl.py +++ b/mmgen/tw/ctl.py @@ -36,7 +36,7 @@ from ..objmethods import MMGenObject from ..obj import TwComment,get_obj from ..addr import CoinAddr,is_mmgen_id,is_coin_addr from ..rpc import rpc_init -from .common import TwMMGenID,TwLabel +from .view import TwMMGenID,TwLabel addr_info = namedtuple('addr_info',['twmmid','coinaddr']) diff --git a/mmgen/tw/txhistory.py b/mmgen/tw/txhistory.py index 6a22ddd8..b5a7dc95 100755 --- a/mmgen/tw/txhistory.py +++ b/mmgen/tw/txhistory.py @@ -19,7 +19,7 @@ from ..base_obj import AsyncInit from ..objmethods import MMGenObject from ..obj import CoinTxID,MMGenList,Int from ..rpc import rpc_init -from .common import TwView +from .view import TwView class TwTxHistory(MMGenObject,TwView,metaclass=AsyncInit): diff --git a/mmgen/tw/unspent.py b/mmgen/tw/unspent.py index 650a5ae9..a92654d3 100755 --- a/mmgen/tw/unspent.py +++ b/mmgen/tw/unspent.py @@ -35,7 +35,7 @@ from ..obj import ( NonNegativeInt ) from ..addr import CoinAddr,MMGenID from ..rpc import rpc_init -from .common import TwView,TwMMGenID,get_tw_label +from .view import TwView,TwMMGenID,get_tw_label class TwUnspentOutputs(MMGenObject,TwView,metaclass=AsyncInit): diff --git a/mmgen/tw/common.py b/mmgen/tw/view.py similarity index 99% rename from mmgen/tw/common.py rename to mmgen/tw/view.py index 021fdaad..170bafb9 100755 --- a/mmgen/tw/common.py +++ b/mmgen/tw/view.py @@ -17,7 +17,7 @@ # along with this program. If not, see . """ -tw: Tracking wallet dependency classes and helper functions +tw.view: base class for tracking wallet view classes """ import sys,time,asyncio @@ -30,7 +30,7 @@ from ..color import nocolor,yellow,green,red,blue from ..util import msg,msg_r,fmt,die,capfirst,make_timestr from ..addr import MMGenID -# mixin class for TwUnspentOutputs,TwAddresses,TwTxHistory: +# base class for TwUnspentOutputs,TwAddresses,TwTxHistory: class TwView: dates_set = False diff --git a/test/objtest.py b/test/objtest.py index 039f3926..de58c990 100755 --- a/test/objtest.py +++ b/test/objtest.py @@ -38,7 +38,7 @@ from mmgen.seedsplit import * from mmgen.addr import * from mmgen.addrlist import * from mmgen.addrdata import * -from mmgen.tw.common import * +from mmgen.tw.view import * from mmgen.amt import * from mmgen.key import * from mmgen.rpc import IPPort diff --git a/test/test_py_d/ts_main.py b/test/test_py_d/ts_main.py index 95385406..5d98f0ee 100755 --- a/test/test_py_d/ts_main.py +++ b/test/test_py_d/ts_main.py @@ -483,7 +483,7 @@ class TestSuiteMain(TestSuiteBase,TestSuiteShared): cmd_args = self._make_txcreate_cmdline(tx_data) if cmdline_inputs: - from mmgen.tw.common import TwLabel + from mmgen.tw.view import TwLabel cmd_args = [ '--inputs={},{},{},{},{},{}'.format( TwLabel(self.proto,dfake[0][self.lbl_id]).mmid,dfake[1]['address'],