Polkit.UnixSession¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2), Polkit.Subject (7)
- Structs:
class |
|
class |
|
class |
|
class |
|
|
Virtual Methods¶
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
w/co |
Process ID to use for looking up the session |
||
r/w/c |
The UNIX session ID |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Polkit.UnixSession(**kwargs)¶
- Bases:
GObject.Object,Gio.AsyncInitable,Gio.Initable,Polkit.Subject- Abstract:
No
- Structure:
An object that represents an user session.
The session id is an opaque string obtained from ConsoleKit.
- classmethod new(session_id)¶
- Parameters:
session_id (
str) – The session id.- Returns:
A
Polkit.UnixSession. Free withGObject.Object.unref().- Return type:
Creates a new
Polkit.UnixSessionfor session_id.
- classmethod new_for_process(pid, cancellable, callback, *user_data)¶
- Parameters:
pid (
int) – The process id of the process to get the session for.cancellable (
Gio.CancellableorNone) – AGio.CancellableorNone.callback (
Gio.AsyncReadyCallbackorNone) – AGio.AsyncReadyCallbackto call when the request is satisfied
Asynchronously creates a new
Polkit.UnixSessionobject for the process with process id pid.When the operation is finished, callback will be invoked in the
thread-default main loopof the thread you are calling this method from. You can then callPolkit.UnixSession.new_for_process_finish() to get the result of the operation.This method constructs the object asynchronously, for the synchronous and blocking version use
Polkit.UnixSession.new_for_process_sync().
- classmethod new_for_process_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – AGio.AsyncResultobtained from theGio.AsyncReadyCallbackpassed toPolkit.UnixSession.new_for_process().- Raises:
- Returns:
A
Polkit.UnixSessionfor the pid passed toPolkit.UnixSession.new_for_process() orNoneif error is set. Free withGObject.Object.unref().- Return type:
Finishes constructing a
Polkit.Subjectfor a process id.
- classmethod new_for_process_sync(pid, cancellable)¶
- Parameters:
pid (
int) – The process id of the process to get the session for.cancellable (
Gio.CancellableorNone) – AGio.CancellableorNone.
- Raises:
- Returns:
A
Polkit.UnixSessionfor pid orNoneif error is set. Free withGObject.Object.unref().- Return type:
Creates a new
Polkit.UnixSessionfor the process with process id pid.This is a synchronous call - the calling thread is blocked until a reply is received. For the asynchronous version, see
Polkit.UnixSession.new_for_process().
- get_session_id()¶
- Returns:
The session id for self. Do not free this string, it is owned by self.
- Return type:
Gets the session id for self.
Property Details¶
- Polkit.UnixSession.props.pid¶
- Name:
pid- Type:
- Default Value:
0- Flags:
The UNIX process id to look up the session.