Skip to content

Commit 1027e59

Browse files
committed
gui: Join wrapped lines to stay under the budget
Join five function signatures and two calls that fit on one line, so the GUI is 1996 lines, under its 2000-line budget, after the matched-group lock. Only formatting changes: the module's AST is identical. Validation: 992 tests pass, normally and under -O; ruff, format and mypy are clean. Claude-Session: https://claude.ai/code/session_018HrKoywz6PT9c91jvKou7Q
1 parent 5311cd6 commit 1027e59

1 file changed

Lines changed: 7 additions & 28 deletions

File tree

‎src/codex32_gui/pages.py‎

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ class Record:
9898

9999

100100
def _page(
101-
title: str,
102-
content: Gtk.Widget,
103-
*,
104-
actions: Gtk.Widget | None = None,
105-
can_pop: bool = True,
101+
title: str, content: Gtk.Widget, *, actions: Gtk.Widget | None = None, can_pop: bool = True
106102
) -> Adw.NavigationPage:
107103
scroller = Gtk.ScrolledWindow(hscrollbar_policy=Gtk.PolicyType.NEVER, vexpand=True)
108104
scroller.set_child(Adw.Clamp(maximum_size=700, child=content, margin_start=18, margin_end=18))
@@ -389,9 +385,7 @@ def home(view: Adw.NavigationView) -> Adw.NavigationPage:
389385

390386

391387
def _connect(
392-
view: Adw.NavigationView,
393-
chain: str | None,
394-
then: Callable[[BitcoinCore], Adw.NavigationPage],
388+
view: Adw.NavigationView, chain: str | None, then: Callable[[BitcoinCore], Adw.NavigationPage]
395389
) -> None:
396390
"""Discover Bitcoin Core before any entropy is drawn or any card is read."""
397391
page = _working(view, "Bitcoin Core", "Looking for Bitcoin Core on this computer…")
@@ -412,9 +406,7 @@ def follow(found: BitcoinCore | tuple[str, ...]) -> Adw.NavigationPage:
412406

413407

414408
def _network_page(
415-
view: Adw.NavigationView,
416-
options: Sequence[str],
417-
then: Callable[[BitcoinCore], Adw.NavigationPage],
409+
view: Adw.NavigationView, options: Sequence[str], then: Callable[[BitcoinCore], Adw.NavigationPage]
418410
) -> Adw.NavigationPage:
419411
group = Adw.PreferencesGroup(title="Bitcoin Core is running on more than one network")
420412
buttons = _radio_group(group, [(label, "") for label in options])
@@ -423,9 +415,7 @@ def _network_page(
423415
group,
424416
)
425417
action = _button(
426-
"Continue",
427-
lambda: _connect(view, options[_selected(buttons)], then),
428-
style="suggested-action",
418+
"Continue", lambda: _connect(view, options[_selected(buttons)], then), style="suggested-action"
429419
)
430420
return _page("Network", content, actions=_actions(action))
431421

@@ -589,10 +579,7 @@ def _layout_page(view: Adw.NavigationView, core: BitcoinCore) -> Adw.NavigationP
589579
title="Cards in total",
590580
adjustment=Gtk.Adjustment(lower=2, upper=31, step_increment=1, value=3),
591581
)
592-
size = Adw.ComboRow(
593-
title="Seed size",
594-
model=Gtk.StringList.new([label for _length, label in SEED_SIZES]),
595-
)
582+
size = Adw.ComboRow(title="Seed size", model=Gtk.StringList.new([label for _length, label in SEED_SIZES]))
596583
# Neither number may leave the other impossible.
597584
needed.connect(
598585
"notify::value",
@@ -669,11 +656,7 @@ def _unshared_page(view: Adw.NavigationView, core: BitcoinCore, secret: MasterSe
669656

670657

671658
def _next_card(
672-
view: Adw.NavigationView,
673-
core: BitcoinCore,
674-
ceremony: CreationCeremony,
675-
position: int,
676-
count: int,
659+
view: Adw.NavigationView, core: BitcoinCore, ceremony: CreationCeremony, position: int, count: int
677660
) -> None:
678661
page = _working(view, f"Card {position + 1} of {count}", "Drawing this card from the operating system…")
679662

@@ -692,11 +675,7 @@ def follow(card: Share) -> Adw.NavigationPage:
692675

693676

694677
def _card_confirmed(
695-
view: Adw.NavigationView,
696-
core: BitcoinCore,
697-
ceremony: CreationCeremony,
698-
position: int,
699-
count: int,
678+
view: Adw.NavigationView, core: BitcoinCore, ceremony: CreationCeremony, position: int, count: int
700679
) -> None:
701680
if position + 1 < count:
702681
_next_card(view, core, ceremony, position + 1, count)

0 commit comments

Comments
 (0)