Foundry.Operation

g Foundry.Operation Foundry.Operation GObject.Object GObject.Object GObject.Object->Foundry.Operation

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

file_progress (current_num_bytes, total_num_bytes, user_data)

class

new ()

await_ ()

cancel ()

complete ()

dup_auth_provider ()

dup_subtitle ()

dup_title ()

get_progress ()

is_cancelled ()

set_auth_provider (auth_provider)

set_progress (progress)

set_subtitle (subtitle)

set_title (title)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

auth-provider

Foundry.AuthProvider

r/w/en

cancelled

bool

r

progress

float

r/w/en

subtitle

str

r/w/en

title

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Name

Short Description

completed

Emitted when the operation has completed successfully.

Fields

Inherited:

GObject.Object (1)

Class Details

class Foundry.Operation(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Foundry.OperationClass

Represents a long-running operation in the development environment with progress tracking.

Foundry.Operation provides a base class for operations that require progress reporting and cancellation support. It integrates with the authentication system and provides a unified interface for managing asynchronous operations with user feedback and error handling.

classmethod file_progress(current_num_bytes, total_num_bytes, user_data)
Parameters:
  • current_num_bytes (int) –

  • total_num_bytes (int) –

  • user_data (object or None) –

classmethod new()
Return type:

Foundry.Operation

await_()
Returns:

a [class`Dex`.Future].

Return type:

Dex.Future

Gets a [class`Dex`.Future] that resolves when the operation has cancelled or completed.

cancel()
complete()
dup_auth_provider()
Return type:

Foundry.AuthProvider or None

dup_subtitle()
Return type:

str

dup_title()
Return type:

str

get_progress()
Return type:

float

is_cancelled()
Return type:

bool

Checks if the operation has been cancelled.

New in version 1.1.

set_auth_provider(auth_provider)
Parameters:

auth_provider (Foundry.AuthProvider) –

set_progress(progress)
Parameters:

progress (float) –

set_subtitle(subtitle)
Parameters:

subtitle (str) –

set_title(title)
Parameters:

title (str) –

Signal Details

Foundry.Operation.signals.completed(operation)
Signal Name:

completed

Flags:

RUN_LAST

Parameters:

operation (Foundry.Operation) – The object which received the signal

Emitted when the operation has completed successfully.

This signal is emitted when [method`Foundry`.Operation.complete] is called to indicate that the operation has finished successfully.

New in version 1.1.

Property Details

Foundry.Operation.props.auth_provider
Name:

auth-provider

Type:

Foundry.AuthProvider

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Operation.props.cancelled
Name:

cancelled

Type:

bool

Default Value:

False

Flags:

READABLE

Foundry.Operation.props.progress
Name:

progress

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Operation.props.subtitle
Name:

subtitle

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Operation.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY