Repository navigation
TurboFrame 0.2.1
TurboFrame 0.2.1
A maintenance release. It fixes the defects that divide and
turbodoo met while adopting v0.2.0, and offers one opt-in way to hold
\n text in the editor while a file keeps its own newlines. Nothing else: no new component and no stage 2
work. Every v0.2.0 import still works, and every signature only gains optional arguments.
TurboFrame is distributed from GitHub only. It is not on PyPI.
Install
pip install "turboframe @ git+https://github.com/divengine/turboframe@v0.2.1"
pip install "turboframe[watch,lsp] @ git+https://github.com/divengine/turboframe@v0.2.1" # with the extrasOr the wheel attached to this release (check it against SHA256SUMS).
Requirements
- Python 3.11 or later; tested on 3.11 and 3.12. Linux and Windows, both required in CI; macOS is not tested.
textual>=8.2,<9,textual-vision==0.0.1, and nowrich>=14.2, declared (it came with Textual before; the
floor is the one Textual 8.2 requires, so no environment changes).- The extras are the same;
lspnow also nameslsprotocol>=2025.0.0, which pygls already pins.
Fixed
| Issue | What was wrong | Now |
|---|---|---|
| #56 | process.split_arguments kept the quotes inside the arguments on Windows (shlex.split(posix=False)) |
Windows splits by the Microsoft C runtime's rules, the inverse of command_line (subprocess.list2cmdline): 'one "two words"' is ["one", "two words"], C:\Users\me stays as typed |
| #51 | process.communicate returned empty output when the time ran out |
it returns what the process wrote until then, with timed_out=True |
| #50 | ui.history.add raised OSError into the dialog when the store could not be written |
nothing is kept and the dialog goes on, as the other settings do |
| #53 | GitMixin.git_command returned None; the language servers' temporary folder was ~/.cache on Windows |
git_command returns True for GIT_COMMANDS, False otherwise; the folder is %LOCALAPPDATA% on Windows ($XDG_CACHE_HOME still wins when set) |
| #52 | the package docstring said it held no components; Rich was imported but not declared | both fixed; a test checks that every package src/ imports is declared |
| #54 | the palette listed the folder's files on the event loop each time it opened, the command palette too | the dialog opens at once and the files are read in a thread; Go to file says "Reading the folder's files..." meanwhile |
| #58 | an Enter typed before Go to file's list was filled was dropped | it acts on the list as soon as it is filled: a name and Enter typed at once open the file |
| #59 | Window > Tile (desktop.tile()) put the editors over the explorer |
the desktop (ui.desktop.DeskTop) tiles beside the docked windows: shown, not tileable, not zoomed, against the left or right edge |
| #60 | an opened editor took the focus back from a window the application raised over it | the editor is focused only while its window is still the active one |
| #55 | the Browse title was not translated; ListWindow.EMPTY was looked up in TurboFrame's catalogue only; init_status_line() ran twice |
translated; ListWindow.empty_text() is the hook an application overrides with its domain; it runs once |
Each fix has a regression test that fails on v0.2.0.
New, opt-in: \n text with the file's newlines kept
By default nothing changes: an editor's text is the file's, \r\n included, and a save writes it back byte for
byte. An application whose offsets count \n newlines (lexers, outlines, member text) can now ask for \n text
instead, and the file keeps its newlines:
from turboframe.ui.editor import EditorWindow
class MyWindow(EditorWindow):
LF = True # the editor holds \n text; a save writes the file's own newlines backUnderneath, for code outside the editor:
files.read_source(path, lf=True)returns\ntext, andSourceFile.newlinenames the file's newline (its
most frequent;\nfor a file without newlines);files.write_source(..., newline=)writes every newline as that one;files.newline_of(text)andfiles.lf_text(text)are the helpers.
With LF = True, Save, Save as, Git's reload of an open file and the explorer's member text all follow it. An
untitled window is written as typed.
Changes to existing modules
None breaks an import or a signature. Behaviour that differs from v0.2.0, besides the fixes above:
process.split_arguments(text, *, strict=False, windows=None):strict=TrueraisesValueErroron bad
quoting instead of splitting on spaces;windows=picks the rules regardless of the platform. The line is never
a shell expression: no variables, globs, pipes, redirections,%VAR%or^.PaletteDialog(files, ...)takesNonefor files still being read and gainsset_files()andlist_ready.
PaletteMixin.palette_items(commands=False)now runs in a thread: an override must not touch widgets there.DesktopApp.init_desktop()returnsui.desktop.DeskTop;desktop.tile(region)with a region is unchanged.ListWindow.empty_text(),EditorWindow.LF,EditorWindow.read(),EditorWindow.newline,
SourceFile.newlineare new.- On Windows, language servers' temporary folders move to
%LOCALAPPDATA%\<app>\tmp; folders left in
~\.cache\<app>\tmpby v0.2.0 are not removed and can be deleted.
Verification
- 444 unit and component tests on Linux (Python 3.11 and 3.12) and Windows (Python 3.12), and the real-terminal
tests on Linux and Windows. On Windows,split_argumentsis also checked against thesys.argva child Python
receives. The workbench's real-terminal test now types a name and Enter into Go to file as soon as it shows,
the case that failed on a loaded CI runner (#58). - The consumers' suites, unchanged, against 0.2.1: divide 760 passed and turbodoo 397 passed, as with v0.2.0.
With their workarounds removed (the integration steps below) they pass as well, and divide's tiling test fails
on v0.2.0 without its workaround. - The release workflow builds the sdist and the wheel once, installs the wheel with its extras in clean
environments on Linux and Windows, and runs the suites against it before publishing.
Integrating in divide
- Dependency:
turboframe[watch,lsp] @ git+https://github.com/divengine/turboframe@v0.2.1(and[i18n]indev). - Replaces: nothing new; the workarounds for #56, #59 and #60 can go.
- Changes possible, each optional:
src/divide/run/script.py:split_argsbecomesturboframe.process.split_arguments(same fallback on bad quoting);src/divide/app.py: drop the_show_editoroverride (#60) and, underCommand.TILE, callself.desktop.tile()(#59);- newlines:
EditorWindow.LF = Trueinstead oflf_source,saved()andProjectTree.member_text's
conversion. That keeps a\r\nfile's newlines on save, where divide saves it with\ntoday; to keep
saving\n, leave the conversion as it is.
- Behaviour changes to expect: Go to file opens at once on a large project and lists the files when read.
- Verify: divide's unit, acceptance and real-terminal suites (its Windows CI for #56 and #60), the wheel in a clean
environment, the binary. - Rollback: pin v0.2.0; the workarounds still work with it.
Integrating in turbodoo
- Dependency:
turboframe[lsp] @ git+https://github.com/divengine/turboframe@v0.2.1. - Replaces:
core/dap.split_arguments, which keeps the quotes on Windows (#56), for its callers intui/. - Changes possible, each optional:
src/turbodoo/tui/debug.py:turboframe.process.split_arguments(text, strict=True): the sameValueError
on bad quoting, the Windows rules fixed.corekeeps the standard library only, so the function there goes
or stays unused;git_commandmay be chained withorinstead of testingGIT_COMMANDSfirst;- newlines:
EditorWindow.LF = Truegives\ntext and keeps\r\non save, as turbodoo does today; the
normalization intui/frontend.pystays for files read outside an editor.
- Behaviour changes to expect: turbodoo tiles with its own region, which is used as given; nothing else.
- Verify: turbodoo's unit, acceptance and real-terminal suites, the wheel in a clean environment, the binary.
- Rollback: pin v0.2.0 (
5a9e869).