Polkit.Subject

g GObject.GInterface GObject.GInterface Polkit.Subject Polkit.Subject GObject.GInterface->Polkit.Subject

Implementations:

Polkit.SystemBusName, Polkit.UnixProcess, Polkit.UnixSession

Methods

class

from_string (str)

equal (b)

exists (cancellable, callback, *user_data)

exists_finish (res)

exists_sync (cancellable)

hash ()

to_string ()

Virtual Methods

do_equal (b)

do_exists (cancellable, callback, *user_data)

do_exists_finish (res)

do_exists_sync (cancellable)

do_hash ()

do_to_string ()

Properties

None

Signals

None

Fields

None

Class Details

class Polkit.Subject
Bases:

GObject.GInterface

Structure:

Polkit.SubjectIface

Polkit.Subject is an abstract type for representing one or more processes.

classmethod from_string(str)
Parameters:

str (str) – A string obtained from Polkit.Subject.to_string().

Raises:

GLib.Error

Returns:

A Polkit.Subject or None if error is set. Free with GObject.Object.unref().

Return type:

Polkit.Subject

Creates an object from str that implements the Polkit.Subject interface.

equal(b)
Parameters:

b (Polkit.Subject) – A Polkit.Subject.

Returns:

True if self and b are equal, False otherwise.

Return type:

bool

Checks if self and b are equal, ie. represent the same subject. However, avoid calling Polkit.Subject.equal() to compare two processes; for more information see the PolkitUnixProcess documentation.

This function can be used in e.g. g_hash_table_new().

exists(cancellable, callback, *user_data)
Parameters:

Asynchronously checks if self exists.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call Polkit.Subject.exists_finish() to get the result of the operation.

exists_finish(res)
Parameters:

res (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to Polkit.Subject.exists().

Raises:

GLib.Error

Returns:

True if the subject exists, False if not or error is set.

Return type:

bool

Finishes checking whether a subject exists.

exists_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the subject exists, False if not or error is set.

Return type:

bool

Checks if self exists.

This is a synchronous blocking call - the calling thread is blocked until a reply is received. See Polkit.Subject.exists() for the asynchronous version.

hash()
Returns:

A hash code.

Return type:

int

Gets a hash code for self that can be used with e.g. g_hash_table_new().

to_string()
Returns:

A string representing self. Free with GLib.free().

Return type:

str

Serializes self to a string that can be used in Polkit.Subject.from_string().

do_equal(b) virtual
Parameters:

b (Polkit.Subject) – A Polkit.Subject.

Returns:

True if a and b are equal, False otherwise.

Return type:

bool

Checks if a and b are equal, ie. represent the same subject. However, avoid calling Polkit.Subject.equal() to compare two processes; for more information see the PolkitUnixProcess documentation.

This function can be used in e.g. g_hash_table_new().

do_exists(cancellable, callback, *user_data) virtual
Parameters:

Asynchronously checks if subject exists.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call Polkit.Subject.exists_finish() to get the result of the operation.

do_exists_finish(res) virtual
Parameters:

res (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to Polkit.Subject.exists().

Returns:

True if the subject exists, False if not or error is set.

Return type:

bool

Finishes checking whether a subject exists.

do_exists_sync(cancellable) virtual
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Returns:

True if the subject exists, False if not or error is set.

Return type:

bool

Checks if subject exists.

This is a synchronous blocking call - the calling thread is blocked until a reply is received. See Polkit.Subject.exists() for the asynchronous version.

do_hash() virtual
Returns:

A hash code.

Return type:

int

Gets a hash code for subject that can be used with e.g. g_hash_table_new().

do_to_string() virtual
Returns:

A string representing subject. Free with GLib.free().

Return type:

str

Serializes subject to a string that can be used in Polkit.Subject.from_string().