PapersView.Job

g GObject.Object GObject.Object PapersView.Job PapersView.Job GObject.Object->PapersView.Job

Subclasses:

PapersView.JobAnnots, PapersView.JobAttachments, PapersView.JobExport, PapersView.JobFind, PapersView.JobFonts, PapersView.JobLayers, PapersView.JobLinks, PapersView.JobLoad, PapersView.JobPageData, PapersView.JobPrint, PapersView.JobRenderTexture, PapersView.JobSave, PapersView.JobSignatures, PapersView.JobThumbnailTexture

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

scheduler_wait ()

cancel ()

failed (error)

get_cancellable ()

get_document ()

is_finished ()

is_succeeded ()

reset ()

run ()

scheduler_push_job (priority)

scheduler_update_job (priority)

succeeded ()

Virtual Methods

Inherited:

GObject.Object (7)

do_cancelled ()

do_finished ()

do_run ()

Properties

Name

Type

Flags

Short Description

document

PapersDocument.Document

w/co

The document

Signals

Inherited:

GObject.Object (1)

Name

Short Description

cancelled

finished

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class PapersView.Job(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

PapersView.JobClass

classmethod scheduler_wait()

Synchronously waits until all jobs are done. Remember that main loop is not running already probably.

cancel()

Cancels the specified job if it has not already been cancelled.

This function updates the job’s state to indicate it has been cancelled, cancels any associated cancellable object, and emits a CANCELLED signal. It does nothing if the job is already cancelled or finished.

This function should not be called from a thread.

failed(error)
Parameters:

error (GLib.Error) – A GLib.Error containing details about the failure.

Marks the specified job as failed and sets the error associated with the failure.

This function updates the job’s state to indicate it has failed, stores the error, and emits a finished signal. It does nothing if the job is already finished or marked as failed.

get_cancellable()
Returns:

The Gio.Cancellable object of the job, or None if the job is invalid or does not have an associated cancellable.

Return type:

Gio.Cancellable

Retrieves the Gio.Cancellable object associated with the specified job.

get_document()
Returns:

The PapersDocument.Document object associated with the job, or None if the job is invalid or does not have an associated document.

Return type:

PapersDocument.Document

Retrieves the PapersDocument.Document associated with the specified job.

is_finished()
Returns:

True if the job is finished, False otherwise.

Return type:

bool

Checks if the specified job has finished execution.

is_succeeded()
Raises:

GLib.Error

Returns:

True if the job succeeded, False otherwise.

Return type:

bool

Determines the finish status of the specified job.

reset()

Resets the state of the specified job to its initial state.

This function clears any error, marks the job as not finished, and sets the job’s failure status to False, effectively resetting its progress.

run()
Returns:

True if the job was successfully started, False otherwise.

Return type:

bool

Starts or executes the specified job.

scheduler_push_job(priority)
Parameters:

priority (PapersView.JobPriority) –

scheduler_update_job(priority)
Parameters:

priority (PapersView.JobPriority) –

succeeded()

Marks the specified job as succeeded.

This function should be called when the job finishes successfully.

do_cancelled() virtual
do_finished() virtual
do_run() virtual
Returns:

True if the job was successfully started, False otherwise.

Return type:

bool

Starts or executes the specified job.

Signal Details

PapersView.Job.signals.cancelled(job)
Signal Name:

cancelled

Flags:

RUN_LAST

Parameters:

job (PapersView.Job) – The object which received the signal

PapersView.Job.signals.finished(job)
Signal Name:

finished

Flags:

RUN_FIRST

Parameters:

job (PapersView.Job) – The object which received the signal

Property Details

PapersView.Job.props.document
Name:

document

Type:

PapersDocument.Document

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The document