build_tools.pipeline_tui.core.app
Main application class for Pipeline TUI.
This module contains the PipelineTuiApp class which is the entry point for the Textual application.
Application Structure:
The app uses a tabbed interface with three main screens:
Configure - Set up extraction parameters
Monitor - Watch job progress and logs
History - Browse previous pipeline runs
Keybindings:
q/Ctrl+Q: Quit application?/F1: Show help1: Switch to Configure tab2: Switch to Monitor tab3: Switch to History tabr: Run pipeline (when configured)c: Cancel running job
Classes
Main application for Pipeline Build Tools TUI. |
Module Contents
- class build_tools.pipeline_tui.core.app.PipelineTuiApp(source_dir=None, output_dir=None, theme='nord')[source]
Bases:
textual.app.AppMain application for Pipeline Build Tools TUI.
A Textual application providing an interactive interface for running syllable extraction, normalization, and annotation pipelines.
- state
Application state (config, job status, UI state)
- theme
Color theme name
- Keybindings:
q: Quit application?: Show help screen1/2/3: Switch tabsr: Run pipelinec: Cancel jobs: Select source directoryo: Select output directory
Initialize the Pipeline TUI application.
- Parameters:
source_dir (pathlib.Path | None) – Initial source directory (optional)
output_dir (pathlib.Path | None) – Initial output directory (optional)
theme (str) – Color theme name (default: “nord”)
- TITLE = 'Pipeline Build Tools'
A class variable to set the default title for the application.
To update the title while the app is running, you can set the [title][textual.app.App.title] attribute. See also [the Screen.TITLE attribute][textual.screen.Screen.TITLE].
- SUB_TITLE = 'Syllable Extraction Pipeline Manager'
A class variable to set the default sub-title for the application.
To update the sub-title while the app is running, you can set the [sub_title][textual.app.App.sub_title] attribute. See also [the Screen.SUB_TITLE attribute][textual.screen.Screen.SUB_TITLE].
- BINDINGS
The default key bindings.
- DEFAULT_CSS = Multiline-String
Show Value
""" PipelineTuiApp { background: $surface; } #main-container { width: 100%; height: 100%; } .status-bar { height: 3; background: $panel; border: solid $primary; padding: 0 1; } .status-label { width: 1fr; } /* Ensure TabPane content fills available space */ TabPane { height: 1fr; width: 1fr; } ContentSwitcher { height: 1fr; width: 1fr; } .placeholder-content { width: 100%; height: 100%; content-align: center middle; color: $text-muted; } """
Default TCSS.
- theme = 'nord'
The name of the currently active theme.
- state
- compose()[source]
Compose the application layout.
Layout: - Header with title - Status bar showing current config summary - Tabbed content (Configure, Monitor, History) - Footer with keybinding hints
- Yields:
Application widget tree
- async action_select_source()[source]
Open directory browser to select source.
Uses shared DirectoryBrowserScreen with source validator. Runs as a worker to support push_screen_wait.
- async action_select_output()[source]
Open directory browser to select output directory.
Uses shared DirectoryBrowserScreen with output validator. Runs as a worker to support push_screen_wait.
- async action_select_files()[source]
Open file selector to choose specific files.
Uses FileSelectorScreen for selecting individual files. Runs as a worker to support push_screen_wait.
- action_run_pipeline()[source]
Start pipeline execution.
Validates configuration and starts the pipeline job.
- on_configure_panel_source_selected(event)[source]
Handle source directory selection request from ConfigurePanel.
Triggers the directory browser modal via the existing action. The browse button in ConfigurePanel posts this message.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.SourceSelected) – Source selected event
- on_configure_panel_output_selected(event)[source]
Handle output directory selection request from ConfigurePanel.
Triggers the directory browser modal via the existing action.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.OutputSelected) – Output selected event
- on_configure_panel_files_selected(event)[source]
Handle file selection request from ConfigurePanel.
Opens the file selector modal for choosing specific files.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.FilesSelected) – Files selected event
- on_configure_panel_extractor_changed(event)[source]
Handle extractor type change from ConfigurePanel.
Updates the application state with the new extractor type. NLTK is English-only, so language setting is ignored for NLTK.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.ExtractorChanged) – Extractor changed event with new extractor type
- on_configure_panel_language_changed(event)[source]
Handle language selection change from ConfigurePanel.
Updates the application state with the new language code. Only applies to pyphen extractor.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.LanguageChanged) – Language changed event with new language code
- on_configure_panel_constraints_changed(event)[source]
Handle constraints change from ConfigurePanel.
Updates syllable length constraints and file pattern in state.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.ConstraintsChanged) – Constraints changed event with new values
- on_configure_panel_pipeline_stages_changed(event)[source]
Handle pipeline stage toggle changes from ConfigurePanel.
Updates which pipeline stages (normalize, annotate) will run.
- Parameters:
event (build_tools.pipeline_tui.screens.configure.ConfigurePanel.PipelineStagesChanged) – Pipeline stages changed event with toggle states