info_file_service
appimage_updater.core.info_file_service
¶
Centralized .info file operations.
This module provides a single service for all .info file operations including finding, reading, and writing .info files consistently across the application.
InfoFileService
¶
Centralized .info file operations.
find_info_file(app_config)
¶
Find .info file using multiple strategies.
Priority: 1. Info file from .current files (rotation naming) 2. Any existing .info files in directory 3. Standard naming convention (fallback)
Returns:
Type | Description |
---|---|
Path | None
|
Path to .info file if found, None if no suitable file exists |
Source code in src/appimage_updater/core/info_file_service.py
read_info_file(info_path)
¶
Read and parse .info file content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
info_path
|
Path
|
Path to the .info file |
required |
Returns:
Type | Description |
---|---|
str | None
|
Parsed version string or None if reading failed |
Source code in src/appimage_updater/core/info_file_service.py
write_info_file(info_path, version)
¶
Write version to .info file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
info_path
|
Path
|
Path where to write the .info file |
required |
version
|
str
|
Version string to write |
required |
Returns:
Type | Description |
---|---|
bool
|
True if successful, False otherwise |