Browse Source

module rename: tw.common -> tw.view

The MMGen Project 2 years ago
parent
commit
5948bd4106

+ 1 - 1
mmgen/addrdata.py

@@ -73,7 +73,7 @@ class TwAddrData(AddrData,metaclass=AsyncInit):
 
 
 	async def __init__(self,proto,wallet=None):
 	async def __init__(self,proto,wallet=None):
 		from .rpc import rpc_init
 		from .rpc import rpc_init
-		from .tw.common import TwLabel
+		from .tw.view import TwLabel
 		from .globalvars import g
 		from .globalvars import g
 		from .seed import SeedID
 		from .seed import SeedID
 		self.proto = proto
 		self.proto = proto

+ 1 - 1
mmgen/main_addrimport.py

@@ -24,7 +24,7 @@ from collections import namedtuple
 
 
 from .common import *
 from .common import *
 from .addrlist import AddrList,KeyAddrList
 from .addrlist import AddrList,KeyAddrList
-from .tw.common import TwLabel
+from .tw.view import TwLabel
 
 
 opts_data = {
 opts_data = {
 	'text': {
 	'text': {

+ 1 - 1
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.addresses import TwAddresses
-from ....tw.common import TwLabel,get_obj
+from ....tw.view import TwLabel,get_obj
 from ....util import msg,msg_r
 from ....util import msg,msg_r
 from ....addr import CoinAddr
 from ....addr import CoinAddr
 from ....obj import NonNegativeInt
 from ....obj import NonNegativeInt

+ 1 - 1
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.bal import TwGetBalance
-from ....tw.common import get_tw_label
+from ....tw.view import get_tw_label
 
 
 class BitcoinTwGetBalance(TwGetBalance):
 class BitcoinTwGetBalance(TwGetBalance):
 
 

+ 1 - 1
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 ....addr import CoinAddr
 from ....util import die,msg,rmsg
 from ....util import die,msg,rmsg
 from ....obj import MMGenList
 from ....obj import MMGenList
-from ....tw.common import get_tw_label
+from ....tw.view import get_tw_label
 
 
 class BitcoinTwCommon:
 class BitcoinTwCommon:
 
 

+ 1 - 1
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 collections import namedtuple
 from ....tw.json import TwJSON
 from ....tw.json import TwJSON
-from ....tw.common import TwMMGenID
+from ....tw.view import TwMMGenID
 
 
 class BitcoinTwJSON(TwJSON):
 class BitcoinTwJSON(TwJSON):
 
 

+ 1 - 1
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 collections import namedtuple
 from ....globalvars import g
 from ....globalvars import g
 from ....tw.txhistory import TwTxHistory
 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 ....addr import CoinAddr
 from ....util import msg,msg_r
 from ....util import msg,msg_r
 from ....color import nocolor,red,pink,gray
 from ....color import nocolor,red,pink,gray

+ 2 - 2
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 ....globalvars import g
 from ....tw.ctl import TrackingWallet
 from ....tw.ctl import TrackingWallet
-from ....tw.common import TwView
+from ....tw.view import TwView
 from ....addr import CoinAddr
 from ....addr import CoinAddr
-from ....tw.common import TwLabel
+from ....tw.view import TwLabel
 
 
 class EthereumTwCommon(TwView):
 class EthereumTwCommon(TwView):
 
 

+ 1 - 1
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 collections import namedtuple
 from ....tw.json import TwJSON
 from ....tw.json import TwJSON
-from ....tw.common import TwMMGenID
+from ....tw.view import TwMMGenID
 
 
 class EthereumTwJSON(TwJSON):
 class EthereumTwJSON(TwJSON):
 
 

+ 1 - 1
mmgen/proto/eth/tw/unspent.py

@@ -20,7 +20,7 @@
 proto.eth.twuo: Ethereum tracking wallet unspent outputs class
 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 ....tw.unspent import TwUnspentOutputs
 from .common import EthereumTwCommon
 from .common import EthereumTwCommon
 
 

+ 1 - 1
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 .common import tool_cmd_base,options_annot_str
-from ..tw.common import TwView
+from ..tw.view import TwView
 from ..tw.txhistory import TwTxHistory
 from ..tw.txhistory import TwTxHistory
 
 
 class tool_cmd(tool_cmd_base):
 class tool_cmd(tool_cmd_base):

+ 1 - 1
mmgen/tw/addresses.py

@@ -19,7 +19,7 @@ from ..obj import MMGenListItem,ImmutableAttr,ListItemAttr,TwComment,NonNegative
 from ..rpc import rpc_init
 from ..rpc import rpc_init
 from ..addr import CoinAddr,MMGenID
 from ..addr import CoinAddr,MMGenID
 from ..color import red,green
 from ..color import red,green
-from .common import TwView,TwMMGenID
+from .view import TwView,TwMMGenID
 
 
 class TwAddresses(MMGenObject,TwView,metaclass=AsyncInit):
 class TwAddresses(MMGenObject,TwView,metaclass=AsyncInit):
 
 

+ 1 - 1
mmgen/tw/ctl.py

@@ -36,7 +36,7 @@ from ..objmethods import MMGenObject
 from ..obj import TwComment,get_obj
 from ..obj import TwComment,get_obj
 from ..addr import CoinAddr,is_mmgen_id,is_coin_addr
 from ..addr import CoinAddr,is_mmgen_id,is_coin_addr
 from ..rpc import rpc_init
 from ..rpc import rpc_init
-from .common import TwMMGenID,TwLabel
+from .view import TwMMGenID,TwLabel
 
 
 addr_info = namedtuple('addr_info',['twmmid','coinaddr'])
 addr_info = namedtuple('addr_info',['twmmid','coinaddr'])
 
 

+ 1 - 1
mmgen/tw/txhistory.py

@@ -19,7 +19,7 @@ from ..base_obj import AsyncInit
 from ..objmethods import MMGenObject
 from ..objmethods import MMGenObject
 from ..obj import CoinTxID,MMGenList,Int
 from ..obj import CoinTxID,MMGenList,Int
 from ..rpc import rpc_init
 from ..rpc import rpc_init
-from .common import TwView
+from .view import TwView
 
 
 class TwTxHistory(MMGenObject,TwView,metaclass=AsyncInit):
 class TwTxHistory(MMGenObject,TwView,metaclass=AsyncInit):
 
 

+ 1 - 1
mmgen/tw/unspent.py

@@ -35,7 +35,7 @@ from ..obj import (
 	NonNegativeInt )
 	NonNegativeInt )
 from ..addr import CoinAddr,MMGenID
 from ..addr import CoinAddr,MMGenID
 from ..rpc import rpc_init
 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):
 class TwUnspentOutputs(MMGenObject,TwView,metaclass=AsyncInit):
 
 

+ 2 - 2
mmgen/tw/common.py → mmgen/tw/view.py

@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 """
 """
-tw: Tracking wallet dependency classes and helper functions
+tw.view: base class for tracking wallet view classes
 """
 """
 
 
 import sys,time,asyncio
 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 ..util import msg,msg_r,fmt,die,capfirst,make_timestr
 from ..addr import MMGenID
 from ..addr import MMGenID
 
 
-# mixin class for TwUnspentOutputs,TwAddresses,TwTxHistory:
+# base class for TwUnspentOutputs,TwAddresses,TwTxHistory:
 class TwView:
 class TwView:
 
 
 	dates_set   = False
 	dates_set   = False

+ 1 - 1
test/objtest.py

@@ -38,7 +38,7 @@ from mmgen.seedsplit import *
 from mmgen.addr import *
 from mmgen.addr import *
 from mmgen.addrlist import *
 from mmgen.addrlist import *
 from mmgen.addrdata import *
 from mmgen.addrdata import *
-from mmgen.tw.common import *
+from mmgen.tw.view import *
 from mmgen.amt import *
 from mmgen.amt import *
 from mmgen.key import *
 from mmgen.key import *
 from mmgen.rpc import IPPort
 from mmgen.rpc import IPPort

+ 1 - 1
test/test_py_d/ts_main.py

@@ -483,7 +483,7 @@ class TestSuiteMain(TestSuiteBase,TestSuiteShared):
 		cmd_args = self._make_txcreate_cmdline(tx_data)
 		cmd_args = self._make_txcreate_cmdline(tx_data)
 
 
 		if cmdline_inputs:
 		if cmdline_inputs:
-			from mmgen.tw.common import TwLabel
+			from mmgen.tw.view import TwLabel
 			cmd_args = [
 			cmd_args = [
 				'--inputs={},{},{},{},{},{}'.format(
 				'--inputs={},{},{},{},{},{}'.format(
 					TwLabel(self.proto,dfake[0][self.lbl_id]).mmid,dfake[1]['address'],
 					TwLabel(self.proto,dfake[0][self.lbl_id]).mmid,dfake[1]['address'],