Browse Source

tw.view: display cleanups

The MMGen Project 6 months ago
parent
commit
79c436b9a4
3 changed files with 7 additions and 7 deletions
  1. 5 5
      mmgen/tw/view.py
  2. 1 1
      test/cmdtest_d/ethdev.py
  3. 1 1
      test/cmdtest_d/shared.py

+ 5 - 5
mmgen/tw/view.py

@@ -385,9 +385,9 @@ class TwView(MMGenObject, metaclass=AsyncInit):
 			return do_ret(get_freews(self.cols, varws, varw, minw))
 
 	def gen_subheader(self, cw, color):
+		c_yellow = (nocolor, yellow)[color]
 		if self.twctl.use_cached_balances:
-			from ..color import nocolor, yellow
-			yield (nocolor, yellow)[color]('Using cached balances. These may be out of date!')
+			yield c_yellow('Using cached balances. These may be out of date!')
 		else:
 			yield f'Displaying balances with {self.minconf} confirmation{suf(self.minconf)}'
 
@@ -725,7 +725,7 @@ class TwView(MMGenObject, metaclass=AsyncInit):
 
 		async def i_balance_refresh(self, parent, idx):
 			if not parent.keypress_confirm(
-					f'Refreshing tracking wallet {parent.item_desc} #{idx}.  Is this what you want?'):
+					f'Refreshing tracking wallet {parent.item_desc} #{idx}. OK?'):
 				return 'redo'
 			await parent.twctl.get_balance(parent.disp_data[idx-1].addr, force_rpc=True)
 			await parent.get_data()
@@ -733,7 +733,7 @@ class TwView(MMGenObject, metaclass=AsyncInit):
 
 		async def i_addr_delete(self, parent, idx):
 			if not parent.keypress_confirm(
-					'Removing {} {} from tracking wallet.  Is this what you want?'.format(
+					'Removing {} {} from tracking wallet. OK?'.format(
 						parent.item_desc, red(f'#{idx}'))):
 				return 'redo'
 			if await parent.twctl.remove_address(parent.disp_data[idx-1].addr):
@@ -784,7 +784,7 @@ class TwView(MMGenObject, metaclass=AsyncInit):
 				parent.oneshot_msg = yellow(f'Label for {desc} unchanged')
 				return None
 			elif res == '':
-				if not parent.keypress_confirm(f'Removing label for {desc}.  Is this what you want?'):
+				if not parent.keypress_confirm(f'Removing label for {desc}. OK?'):
 					return 'redo'
 
 			return await do_comment_add(res)

+ 1 - 1
test/cmdtest_d/ethdev.py

@@ -1592,7 +1592,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared):
 		for n in bals:
 			t.expect('[R]efresh balance:\b', 'R')
 			t.expect(' main menu): ', n+'\n')
-			t.expect('Is this what you want? (y/N): ', 'y')
+			t.expect('OK? (y/N): ', 'y')
 		t.expect('[R]efresh balance:\b', 'q')
 		t.expect(rf'Total unspent:.*\D{total}\D.*{total_coin}', regex=True)
 		return t

+ 1 - 1
test/cmdtest_d/shared.py

@@ -63,7 +63,7 @@ class CmdTestShared:
 
 		expect_pat = r'\[q\]uit menu, .*?:.'
 		delete_pat = r'Enter account number .*:.'
-		confirm_pat = r'Is this what you want.*:.'
+		confirm_pat = r'OK\?.*:.'
 
 		if used_chg_addr_resp is not None:
 			t.expect('reuse harms your privacy.*:.*', used_chg_addr_resp, regex=True)