usawa

Signed, immutable accounting.
Log | Files | Refs | Submodules | LICENSE

commit 3ecaf3f15e0e32235f61d27e8112fb58bd5b85c9
parent b0e5eb47d2dccb324b86f4adbce069aaf04c7046
Author: Carlosokumu <carlosokumu254@gmail.com>
Date:   Fri, 13 Mar 2026 19:51:51 +0300

process setup-wallet command

Diffstat:
Mdummy/usawa/gui/__init__.py | 30++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/dummy/usawa/gui/__init__.py b/dummy/usawa/gui/__init__.py @@ -2,29 +2,33 @@ import logging import signal import gi -gi.require_version('Gtk', '4.0') -gi.require_version('Adw', '1') -from gi.repository import Gtk, Adw,Gio +from usawa.core.setup_wallet import setup_wallet + +gi.require_version("Gtk", "4.0") +gi.require_version("Adw", "1") +from gi.repository import Gtk, Adw, Gio from .main_window import UsawaMainWindow from usawa.config import load as load_config + logg = logging.getLogger("gui.app") + class Usawa(Adw.Application): def __init__(self, *args, **kwargs): - super().__init__(flags= Gio.ApplicationFlags.HANDLES_COMMAND_LINE,*args, **kwargs) + super().__init__( + flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, *args, **kwargs + ) self.win = None self.ledger_file = None self.cfg = None - self.connect('activate', self.on_activate) + self.connect("activate", self.on_activate) signal.signal(signal.SIGINT, self._handle_sigint) - def on_activate(self, app): - self.win = UsawaMainWindow(application=app,ledger_path=self.ledger_file) + self.win = UsawaMainWindow(application=app, ledger_path=self.ledger_file) self.win.present() - - def _handle_sigint(self,*_): + def _handle_sigint(self, *_): logg.debug("shutdown") self.quit() @@ -32,10 +36,13 @@ class Usawa(Adw.Application): args = cli.get_arguments() if len(args) > 1: - self.ledger_file = args[1] + if args[1] == "setup-wallet": + setup_wallet() + return 0 + self.ledger_file = args[1] self.cfg = load_config() for k in self.cfg.all(): logg.debug("config {} => {}".format(k, self.cfg.get(k))) self.activate() - return 0 -\ No newline at end of file + return 0