Skip to content
Snippets Groups Projects

Automatically add accounts to a known list after performing the appropriate actions

Merged Jakub Ziebinski requested to merge jziebinski/known-accounts into develop
Compare and Show latest version
3 files
+ 10
13
Compare changes
  • Side-by-side
  • Inline
Files
3
from __future__ import annotations
import contextlib
from typing import TYPE_CHECKING, Any, ClassVar, Final, Literal
from pydantic import ValidationError
from textual.binding import Binding
from textual.css.query import NoMatches
from clive.__private.abstract_class import AbstractClassMessagePump
from clive.__private.core import iwax
@@ -185,14 +183,10 @@ class OperationActionBindings(CliveWidget, AbstractClassMessagePump):
return True
def _add_account_to_known_after_action(self) -> None:
with contextlib.suppress(NoMatches):
account_inputs = self.query(AccountNameInput)
account_inputs = self.query(AccountNameInput)
for account_input in account_inputs:
account_name = account_input.value_or_error
if not self.profile.accounts.is_account_known(account_name):
self.profile.accounts.known.add(account_name)
for account_input in account_inputs:
account_input.add_account_to_known()
def ensure_operations_list(self) -> list[OperationUnion]:
operation = self.create_operation()
Loading