nightly-0dd6df84-ls250
Pre-releaseCI Report:
https://ci-tests.linuxserver.io/linuxserver/beets/nightly-0dd6df84-ls250/index.html
LinuxServer Changes:
Full Changelog: nightly-2c6f239a-ls249...nightly-0dd6df84-ls250
Remote Changes:
Move utils from ui to util (#6440)
Refactor: Extract UI utilities into beets/util
This PR decouples terminal/display utilities from beets/ui by moving
them into focused modules under beets/util. No user-facing behaviour
changes.
What moved where
| Utility | From | To |
|---|---|---|
colorize, uncolorize, color_len, color_split, ANSI constants |
||
beets/ui/__init__.py |
beets/util/color.py |
|
colordiff, _field_diff, get_model_changes |
||
beets/ui/__init__.py |
beets/util/diff.py |
|
indent, split_into_lines, print_column_layout, |
||
print_newline_layout |
beets/ui/__init__.py |
beets/util/layout.py |
|
Notable design change in layout.py
print_column_layout / print_newline_layout previously called
ui.print_() internally, creating a hard dependency on beets.ui. They
are now renamed to get_column_layout / get_newline_layout and
converted to generators, yielding lines instead of printing them.
The caller (display.py) is responsible for printing via ui.print_().
New public API
get_model_changes is introduced in beets/util/diff.py as the pure,
testable function for computing field-level diffs. show_model_changes
in beets/ui now delegates to it.
Tests
- Moved alongside the code:
test/util/test_color.py,
test/util/test_diff.py,test/util/test_layout.py. - Removed duplicate
ShowModelChangeTestfromtest/ui/test_ui.py—
coverage is preserved intest/util/test_diff.py.