Infinity.UserTable

g GObject.Object GObject.Object Infinity.UserTable Infinity.UserTable GObject.Object->Infinity.UserTable

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_user (user)

foreach_local_user (func, *user_data)

foreach_user (func, *user_data)

lookup_user_by_id (id)

lookup_user_by_name (name)

remove_user (user)

Virtual Methods

Inherited:

GObject.Object (7)

do_add_available_user (user)

do_add_local_user (user)

do_add_user (user)

do_remove_available_user (user)

do_remove_local_user (user)

do_remove_user (user)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

add-available-user

This signal is emitted when a user in the user table becomes available, i.e.

add-local-user

This signal is emitted when a user is added to the user table and has the Infinity.UserFlags.LOCAL flag set.

add-user

This signal is emitted when Infinity.UserTable.add_user() is called.

remove-available-user

This signal is emitted when a user in the user table became unavailable, i.e.

remove-local-user

This signal is emitted when a user is removed from the user table and had the Infinity.UserFlags.LOCAL flag set.

remove-user

This signal is emitted when Infinity.UserTable.remove_user() is called.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Infinity.UserTable(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Infinity.UserTableClass

Infinity.UserTable is an opaque data type. You should only access it via the public API functions.

classmethod new()
Returns:

A Infinity.UserTable.

Return type:

Infinity.UserTable

Creates a new, empty user table.

add_user(user)
Parameters:

user (Infinity.User) – A Infinity.User not already contained in self.

Inserts user into self.

foreach_local_user(func, *user_data)
Parameters:

Calls the given function for each local user in the user_table. A local user is a user that has the Infinity.UserFlags.LOCAL flag set and that has not status Infinity.UserStatus.UNAVAILABLE. You should not add or remove users while this function is being executed.

foreach_user(func, *user_data)
Parameters:

Calls the given function for each user in the user_table. You should not add or remove users while this function is being executed.

lookup_user_by_id(id)
Parameters:

id (int) – User ID to lookup.

Returns:

A Infinity.User, or None.

Return type:

Infinity.User or None

Returns the Infinity.User with the given User ID in self.

lookup_user_by_name(name)
Parameters:

name (str) – User name to lookup.

Returns:

A Infinity.User, or None.

Return type:

Infinity.User or None

Returns an Infinity.User with the given name if there is one.

remove_user(user)
Parameters:

user (Infinity.User) – A Infinity.User contained in table.

Removes user from uesr_table.

do_add_available_user(user) virtual
Parameters:

user (Infinity.User) –

do_add_local_user(user) virtual
Parameters:

user (Infinity.User) –

do_add_user(user) virtual
Parameters:

user (Infinity.User) – A Infinity.User not already contained in user_table.

Inserts user into user_table.

do_remove_available_user(user) virtual
Parameters:

user (Infinity.User) –

do_remove_local_user(user) virtual
Parameters:

user (Infinity.User) –

do_remove_user(user) virtual
Parameters:

user (Infinity.User) – A Infinity.User contained in table.

Removes user from uesr_table.

Signal Details

Infinity.UserTable.signals.add_available_user(user_table, user)
Signal Name:

add-available-user

Flags:

RUN_LAST

Parameters:

This signal is emitted when a user in the user table becomes available, i.e. its status is not Infinity.UserStatus.UNAVAILABLE. The signal is also emitted when a new user is added to the user table who is available, in addition to Infinity.UserTable ::add-user and possibly Infinity.UserTable ::add-local-user.

Infinity.UserTable.signals.add_local_user(user_table, user)
Signal Name:

add-local-user

Flags:

RUN_LAST

Parameters:

This signal is emitted when a user is added to the user table and has the Infinity.UserFlags.LOCAL flag set. In this case, Infinity.UserTable ::add-user is emitted as well.

This signal is also emitted when an existing user receives the Infinity.UserFlags.LOCAL flag. This occurs when a user rejoins locally after leaving the session (possibly having the Infinity.UserFlags.LOCAL flag removed during their absence). Infinity.UserTable ::add-user is not emitted in this case.

Infinity.UserTable.signals.add_user(user_table, user)
Signal Name:

add-user

Flags:

RUN_LAST

Parameters:

This signal is emitted when Infinity.UserTable.add_user() is called. Note that this does not happen if user rejoins the session and has already been added to user_table previously.

Infinity.UserTable ::add-local-user may also be emitted at this point if user has the Infinity.UserFlags.LOCAL flag set.

Infinity.UserTable.signals.remove_available_user(user_table, user)
Signal Name:

remove-available-user

Flags:

RUN_LAST

Parameters:

This signal is emitted when a user in the user table became unavailable, i.e. its status has changed to Infinity.UserStatus.UNAVAILABLE. The signal is also emitted when a user who was available has been removed from the user table, in addition to Infinity.UserTable ::remove-user and possibly Infinity.UserTable ::remove-local-user.

Infinity.UserTable.signals.remove_local_user(user_table, user)
Signal Name:

remove-local-user

Flags:

RUN_LAST

Parameters:

This signal is emitted when a user is removed from the user table and had the Infinity.UserFlags.LOCAL flag set. In this case, Infinity.UserTable ::remove-user is emitted as well.

This signal is also emitted when user loses the Infinity.UserFlags.LOCAL flag. This occurs when the local user leaves the session. Infinity.UserTable ::remove-user is not emitted and the status of user is set to Infinity.UserStatus.UNAVAILABLE.

Infinity.UserTable.signals.remove_user(user_table, user)
Signal Name:

remove-user

Flags:

RUN_LAST

Parameters:

This signal is emitted when Infinity.UserTable.remove_user() is called. This does not usually happen, as users leaving a session do not get removed from the table.

Infinity.UserTable ::remove-local-user may also be emitted at this point if user has the Infinity.UserFlags.LOCAL flag set.