rich_formatter
appimage_updater.ui.output.rich_formatter
¶
Rich console output formatter implementation.
RichOutputFormatter(console=None, verbose=False, **kwargs)
¶
Rich console output formatter.
This formatter provides the existing Rich console behavior, maintaining backward compatibility while implementing the OutputFormatter protocol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
console
|
Console | None
|
Optional Rich console instance. Creates default if not provided. |
None
|
verbose
|
bool
|
Enable verbose output (currently unused but accepted for compatibility) |
False
|
**kwargs
|
Any
|
Additional arguments (ignored for compatibility) |
{}
|
Source code in src/appimage_updater/ui/output/rich_formatter.py
console = console or Console(no_color=(bool(os.environ.get('NO_COLOR'))))
instance-attribute
¶
verbose = verbose
instance-attribute
¶
end_section()
¶
finalize()
¶
Finalize Rich output.
Rich output goes directly to console, so this returns None.
Returns:
Type | Description |
---|---|
str | None
|
None for console output |
print(message, **kwargs)
¶
Print a message with Rich styling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to print |
required |
**kwargs
|
Any
|
Rich console print options (style, highlight, etc.) |
{}
|
Source code in src/appimage_updater/ui/output/rich_formatter.py
print_application_list(applications)
¶
Display application list using Rich table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
applications
|
list[dict[str, Any]]
|
List of application dictionaries |
required |
Source code in src/appimage_updater/ui/output/rich_formatter.py
print_check_results(results)
¶
Display check results using Rich table formatting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results
|
list[dict[str, Any]]
|
List of check result dictionaries |
required |
Source code in src/appimage_updater/ui/output/rich_formatter.py
print_config_settings(settings)
¶
Display configuration settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict[str, Any]
|
Dictionary of configuration settings |
required |
Source code in src/appimage_updater/ui/output/rich_formatter.py
print_error(message)
¶
Display error message with red styling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Error message to display |
required |
print_info(message)
¶
Display info message with blue styling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Info message to display |
required |
print_progress(current, total, description='')
¶
Display progress information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current
|
int
|
Current progress value |
required |
total
|
int
|
Total progress value |
required |
description
|
str
|
Optional progress description |
''
|
Source code in src/appimage_updater/ui/output/rich_formatter.py
print_success(message)
¶
Display success message with green styling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Success message to display |
required |
print_table(data, title='', headers=None)
¶
Display tabular data using Rich Table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
list[dict[str, Any]]
|
List of dictionaries representing table rows |
required |
title
|
str
|
Optional table title |
''
|
headers
|
list[str] | None
|
Optional custom headers (uses dict keys if not provided) |
None
|
Source code in src/appimage_updater/ui/output/rich_formatter.py
print_warning(message)
¶
Display warning message with yellow styling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Warning message to display |
required |
start_section(title)
¶
Start a new output section with Rich panel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
Section title |
required |