json_formatter
appimage_updater.ui.output.json_formatter
¶
JSON output formatter implementation.
JSONOutputFormatter(**kwargs)
¶
JSON output formatter for programmatic consumption.
This formatter collects all output data and produces a structured JSON document at the end, suitable for automation and scripting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional arguments (ignored for compatibility) |
{}
|
Source code in src/appimage_updater/ui/output/json_formatter.py
data = {'messages': [], 'tables': [], 'check_results': [], 'application_list': [], 'config_settings': [], 'errors': [], 'warnings': [], 'info': [], 'success': [], 'sections': []}
instance-attribute
¶
end_section()
¶
End the current output section for JSON output.
finalize()
¶
Finalize JSON output and print the complete JSON document.
Returns:
Type | Description |
---|---|
str | None
|
None (output goes directly to stdout) |
Source code in src/appimage_updater/ui/output/json_formatter.py
print(message, **kwargs)
¶
Print a message (store for JSON output).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to store |
required |
**kwargs
|
Any
|
Additional options (ignored for JSON) |
{}
|
Source code in src/appimage_updater/ui/output/json_formatter.py
print_application_list(applications)
¶
Store application list for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
applications
|
list[dict[str, Any]]
|
List of application dictionaries |
required |
Source code in src/appimage_updater/ui/output/json_formatter.py
print_check_results(results)
¶
Store check results for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results
|
list[dict[str, Any]]
|
List of check result dictionaries |
required |
print_config_settings(settings)
¶
Store configuration settings for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict[str, Any]
|
Dictionary of configuration settings |
required |
Source code in src/appimage_updater/ui/output/json_formatter.py
print_error(message)
¶
Store error message for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Error message to store |
required |
print_info(message)
¶
Store info message for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Info message to store |
required |
print_progress(current, total, description='')
¶
Store progress information for JSON output.
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/json_formatter.py
print_success(message)
¶
Store success message for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Success message to store |
required |
print_table(data, title='', headers=None)
¶
Store tabular data for JSON output.
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 |
None
|
Source code in src/appimage_updater/ui/output/json_formatter.py
print_warning(message)
¶
Store warning message for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Warning message to store |
required |
start_section(title)
¶
Start a new output section for JSON output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
Section title |
required |