pyanaconda.modules.common.task.task_interface

Classes

TaskInterface

Base class for implementing Task.

ValidationTaskInterface

DBus interface for a validation task.

Module Contents

class pyanaconda.modules.common.task.task_interface.TaskInterface[source]

Bases: pyanaconda.modules.common.base.base_template.InterfaceTemplate

Base class for implementing Task.

This class has only interface of the Task. Logic will be implemented by each module.

connect_signals()[source]

Connect signals to the implementation.

property Name: Str[source]

Get the name of this task.

Return type:

Str

property Progress: Tuple[Int, Str][source]

Get immediate progress of this task.

Returns:

Tuple with actual step count and description of this step.

Return type:

Tuple[Int, Str]

ProgressChanged(step, message)[source]

Signal making progress for this task.

Parameters:
  • step (Int) – Number of the actual step. Please look on the self.Steps to calculate progress percentage.

  • message (Str) – Short description of what is this task currently trying to do.

property Steps: Int[source]

Get total number of steps for this task.

Return type:

Int

property IsRunning: Bool[source]

Return True if this Task is running already.

Return type:

Bool

Started()[source]

Signal when this task starts.

Stopped()[source]

Signal when this task stops.

Failed()[source]

Signal when this task fails.

Succeeded()[source]

Signal when this task succeeds.

Start()[source]

Run the task work.

Cancel()[source]

Cancel the task.

Finish()[source]

Finish the task after it stopped.

This method will raise an error if the task has failed.

static convert_result(value)[source]

Convert the value of the result.

Convert the value into a variant.

Parameters:

value – a value of the result

Returns:

a variant with the value

Raises:

NoResultError by default

Return type:

Variant

GetResult()[source]

Get the result of the task if any.

Returns:

a variant with the result

Raises:

NoResultError by default

Return type:

Variant

class pyanaconda.modules.common.task.task_interface.ValidationTaskInterface[source]

Bases: TaskInterface

DBus interface for a validation task.

static convert_result(value)[source]

Convert the validation report.

Convert the validation report into a variant.

Parameters:

value – a validation report

Returns:

a variant with the structure

Return type:

Variant