From 79c436b9a49705e12e9aa21bfe20be1f9989ca91 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 28 May 2025 11:40:40 +0000 Subject: [PATCH] tw.view: display cleanups --- mmgen/tw/view.py | 10 +++++----- test/cmdtest_d/ethdev.py | 2 +- test/cmdtest_d/shared.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mmgen/tw/view.py b/mmgen/tw/view.py index b2bebb7c..4b73ecc4 100755 --- a/mmgen/tw/view.py +++ b/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) diff --git a/test/cmdtest_d/ethdev.py b/test/cmdtest_d/ethdev.py index 9e1a1e34..e36408a0 100755 --- a/test/cmdtest_d/ethdev.py +++ b/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 diff --git a/test/cmdtest_d/shared.py b/test/cmdtest_d/shared.py index 76868e28..295e3df6 100755 --- a/test/cmdtest_d/shared.py +++ b/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)