operations
appimage_updater.config.operations
¶
Configuration operations for AppImage updater.
console = Console(no_color=(bool(os.environ.get('NO_COLOR'))))
module-attribute
¶
apply_basic_config_updates(app, updates)
¶
Apply basic configuration updates (URL, directory, pattern, status).
Source code in src/appimage_updater/config/operations.py
apply_checksum_updates(app, updates)
¶
Apply checksum-related updates.
Source code in src/appimage_updater/config/operations.py
apply_configuration_updates(app, updates)
¶
Apply the updates to the application configuration object.
Returns:
Type | Description |
---|---|
list[str]
|
List of change descriptions for display. |
Source code in src/appimage_updater/config/operations.py
apply_rotation_updates(app, updates)
¶
Apply rotation-related updates.
Source code in src/appimage_updater/config/operations.py
collect_checksum_edit_updates(checksum, checksum_algorithm, checksum_pattern, checksum_required)
¶
Collect checksum-related configuration updates.
Source code in src/appimage_updater/config/operations.py
collect_edit_updates(url, download_dir, basename, pattern, enable, prerelease, rotation, symlink_path, retain_count, checksum, checksum_algorithm, checksum_pattern, checksum_required, force=False, direct=None, auto_subdir=None, app=None)
¶
Collect all configuration updates for edit command.
Source code in src/appimage_updater/config/operations.py
collect_rotation_edit_updates(rotation, symlink_path, retain_count)
¶
Collect rotation-related configuration updates.
Source code in src/appimage_updater/config/operations.py
convert_app_to_dict(app)
¶
Convert application object to dictionary for JSON serialization.
Source code in src/appimage_updater/config/operations.py
determine_save_target(config_file, config_dir)
¶
Determine where to save the configuration (file or directory).
Source code in src/appimage_updater/config/operations.py
expand_symlink_path(symlink_path)
¶
Expand and make symlink path absolute if needed.
Source code in src/appimage_updater/config/operations.py
generate_default_config(name, url, download_dir=None, rotation=None, retain=None, symlink=None, prerelease=None, checksum=None, checksum_algorithm=None, checksum_pattern=None, checksum_required=None, pattern=None, direct=None, global_config=None)
async
¶
Generate a default application configuration.
Returns:
Name | Type | Description |
---|---|---|
tuple |
tuple[dict[str, Any], bool]
|
(config_dict, prerelease_auto_enabled) |
Source code in src/appimage_updater/config/operations.py
handle_add_directory_creation(download_dir, create_dir, yes=False)
¶
Handle download directory path expansion and creation for add command.
Source code in src/appimage_updater/config/operations.py
handle_directory_creation(updates, create_dir, yes=False)
¶
Handle download directory creation if needed.
Source code in src/appimage_updater/config/operations.py
handle_path_expansions(updates)
¶
Handle path expansion for download directory.
normalize_and_validate_symlink_path(expanded_path, original_path)
¶
Normalize path and validate parent directory and extension.
Source code in src/appimage_updater/config/operations.py
save_updated_configuration(app, config, config_file, config_dir)
¶
Save the updated configuration back to file or directory.
Source code in src/appimage_updater/config/operations.py
update_app_in_config_directory(app_dict, config_dir)
¶
Update application in a directory-based config structure.
Source code in src/appimage_updater/config/operations.py
update_app_in_config_file(app_dict, config_file)
¶
Update application in a single JSON config file.
Source code in src/appimage_updater/config/operations.py
validate_add_rotation_config(rotation, symlink)
¶
Validate rotation and symlink combination for add command.
Returns:
Type | Description |
---|---|
bool
|
True if valid, False if invalid |
Source code in src/appimage_updater/config/operations.py
validate_and_normalize_add_url(url, direct=None)
¶
Validate and normalize URL for add command.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
The URL to validate |
required |
direct
|
bool | None
|
If True, treat as direct download URL and skip repository validation |
None
|
Returns:
Type | Description |
---|---|
str | None
|
Normalized URL if valid, None if invalid |
Source code in src/appimage_updater/config/operations.py
validate_basic_field_updates(updates)
¶
Validate basic field updates.
Source code in src/appimage_updater/config/operations.py
validate_edit_updates(app, updates, create_dir, yes=False)
¶
Validate the proposed updates before applying them.
Source code in src/appimage_updater/config/operations.py
validate_rotation_consistency(app, updates)
¶
Validate rotation configuration consistency.
Source code in src/appimage_updater/config/operations.py
validate_symlink_path(updates)
¶
Validate symlink path if provided.
Source code in src/appimage_updater/config/operations.py
validate_symlink_path_characters(expanded_path, original_path)
¶
Check if path contains invalid characters.
Source code in src/appimage_updater/config/operations.py
validate_symlink_path_exists(symlink_path)
¶
Check if symlink path is not empty or whitespace-only.
Source code in src/appimage_updater/config/operations.py
validate_url_update(updates)
¶
Validate URL update if provided.