Skip to content

progress_events

appimage_updater.events.progress_events

Progress and status events for the AppImage Updater.

DownloadProgressEvent(app_name, filename, downloaded_bytes, total_bytes, speed_bps=None, **kwargs)

Event for download progress updates.

Parameters:

Name Type Description Default
app_name str

Name of the application being downloaded

required
filename str

Name of the file being downloaded

required
downloaded_bytes int

Bytes downloaded so far

required
total_bytes int

Total bytes to download

required
speed_bps float | None

Download speed in bytes per second

None
**kwargs Any

Additional event data

{}
Source code in src/appimage_updater/events/progress_events.py
def __init__(
    self,
    app_name: str,
    filename: str,
    downloaded_bytes: int,
    total_bytes: int,
    speed_bps: float | None = None,
    **kwargs: Any,
):
    """Initialize download progress event.

    Args:
        app_name: Name of the application being downloaded
        filename: Name of the file being downloaded
        downloaded_bytes: Bytes downloaded so far
        total_bytes: Total bytes to download
        speed_bps: Download speed in bytes per second
        **kwargs: Additional event data
    """
    message = f"Downloading {filename} for {app_name}"
    if speed_bps:
        speed_mb = speed_bps / (1024 * 1024)
        message += f" ({speed_mb:.1f} MB/s)"

    super().__init__(
        operation="download",
        current=downloaded_bytes,
        total=total_bytes,
        message=message,
        **kwargs,
    )
    self.app_name = app_name
    self.filename = filename
    self.speed_bps = speed_bps

app_name = app_name instance-attribute

filename = filename instance-attribute

speed_bps = speed_bps instance-attribute

ProgressEvent(operation, current, total, message=None, **kwargs)

Base class for progress-related events.

Parameters:

Name Type Description Default
operation str

Name of the operation in progress

required
current int

Current progress value

required
total int

Total expected value

required
message str | None

Optional progress message

None
**kwargs Any

Additional event data

{}
Source code in src/appimage_updater/events/progress_events.py
def __init__(
    self,
    operation: str,
    current: int,
    total: int,
    message: str | None = None,
    **kwargs: Any,
):
    """Initialize progress event.

    Args:
        operation: Name of the operation in progress
        current: Current progress value
        total: Total expected value
        message: Optional progress message
        **kwargs: Additional event data
    """
    super().__init__(**kwargs)
    self.operation = operation
    self.current = current
    self.total = total
    self.message = message

current = current instance-attribute

message = message instance-attribute

operation = operation instance-attribute

total = total instance-attribute

UpdateCheckEvent(app_name, status, current_version=None, available_version=None, update_available=False, error=None, **kwargs)

Event for update check progress and results.

Parameters:

Name Type Description Default
app_name str

Name of the application being checked

required
status str

Status of the check (checking, completed, error)

required
current_version str | None

Current version of the application

None
available_version str | None

Available version if update exists

None
update_available bool

Whether an update is available

False
error str | None

Error message if check failed

None
**kwargs Any

Additional event data

{}
Source code in src/appimage_updater/events/progress_events.py
def __init__(
    self,
    app_name: str,
    status: str,
    current_version: str | None = None,
    available_version: str | None = None,
    update_available: bool = False,
    error: str | None = None,
    **kwargs: Any,
):
    """Initialize update check event.

    Args:
        app_name: Name of the application being checked
        status: Status of the check (checking, completed, error)
        current_version: Current version of the application
        available_version: Available version if update exists
        update_available: Whether an update is available
        error: Error message if check failed
        **kwargs: Additional event data
    """
    super().__init__(**kwargs)
    self.app_name = app_name
    self.status = status
    self.current_version = current_version
    self.available_version = available_version
    self.update_available = update_available
    self.error = error

app_name = app_name instance-attribute

available_version = available_version instance-attribute

current_version = current_version instance-attribute

error = error instance-attribute

status = status instance-attribute

update_available = update_available instance-attribute