pattern_generator
appimage_updater.core.pattern_generator
¶
Pattern generation and URL handling for AppImage files.
This module contains functions for parsing GitHub URLs, normalizing repository URLs, generating regex patterns for AppImage file matching, and detecting prerelease-only repositories.
detect_source_type(url)
¶
fetch_appimage_pattern_from_github(url)
async
¶
Legacy function name - now redirects to repository-agnostic version.
find_common_prefix(strings)
¶
Find the longest common prefix among a list of strings.
Source code in src/appimage_updater/core/pattern_generator.py
generate_appimage_pattern_async(app_name, url)
async
¶
Repository-agnostic pattern generation for use in async contexts.
an accurate pattern. Works with GitHub, GitLab, and other repository types. Falls back to intelligent defaults if that fails.
Source code in src/appimage_updater/core/pattern_generator.py
normalize_github_url(url)
¶
Normalize GitHub URL to repository format and detect if it was corrected.
Detects GitHub download URLs (releases/download/...) and converts them to repository URLs. Returns (normalized_url, was_corrected) tuple.
Source code in src/appimage_updater/core/pattern_generator.py
should_enable_prerelease(url)
async
¶
Check if prerelease should be automatically enabled for a repository.
Returns True if the repository only has prerelease versions (like continuous builds) and no stable releases, indicating that prerelease support should be enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if only prereleases are found, False if stable releases exist or on error |