Accounts.Manager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether to abort the application on DB timeout |
||
r/w |
Timeout for DB operations (ms) |
||
r/w/co |
Set service type |
||
r/w/co |
Whether to use D-Bus for IPC |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a new account has been created; note that the account must have been stored in the database: the signal is not emitted just in response to |
|
Emitted when an account has been deleted. |
|
Emitted when particular service of an account has been updated. |
|
If the manager has been created with |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Accounts.Manager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Opaque structure. Use related accessor functions.
- classmethod list_free(list)¶
- Parameters:
list ([
int
]) – aGLib.List
returned from aAccounts.Manager
method which returns account IDs.
Frees the memory taken by a
GLib.List
of #AgAccountId allocated byAccounts.Manager
, such as byAccounts.Manager.list
(),Accounts.Manager.list_enabled
() orAccounts.Manager.list_enabled_by_service_type
().
- classmethod new()¶
- Returns:
an instance of an
Accounts.Manager
.- Return type:
Create a new
Accounts.Manager
.
- classmethod new_for_service_type(service_type)¶
- Parameters:
service_type (
str
) – the name of a service type- Returns:
an
Accounts.Manager
instance with the specified service type.- Return type:
Create a new
Accounts.Manager
with the service type with the name service_type.
- create_account(provider_name)¶
- Parameters:
provider_name (
str
) – name of the provider of the account.- Returns:
a new
Accounts.Account
, orNone
.- Return type:
Create a new account. The account is not stored in the database until
Accounts.Account.store
() has successfully returned; the id field in theAccounts.Account
structure is also not meant to be valid until the account has been stored.
- get_abort_on_db_timeout()¶
-
Get whether the library will abort when a timeout error occurs.
- get_account(account_id)¶
- Parameters:
account_id (
int
) – the #AgAccountId of the account.- Returns:
an
Accounts.Account
, on which the client must callGObject.Object.unref
() when it is no longer required, orNone
if an error occurs.- Return type:
Instantiates the object representing the account identified by account_id.
- get_account_services()¶
- Returns:
a list of
Accounts.AccountService
objects. When done with it, callGObject.Object.unref
() on the list elements, and g_list_free() on the container.- Return type:
Gets all the account services. If the self was created for a specific service type, only services with that type will be returned.
This method causes the loading of all the service settings for all the returned accounts (unless they have been loaded previously). If you are interested in a specific account/service, consider using
Accounts.Manager.load_account
() to first load the the account, and then create theAccounts.AccountService
for that account only.
- get_application(application_name)¶
- Parameters:
application_name (
str
) – the name of an application to search for- Returns:
a new
Accounts.Application
if one was found,None
otherwise- Return type:
Search for application_name in the list of applications, and return a new
Accounts.Application
if a matching application was found.
- get_db_timeout()¶
- Returns:
the timeout (in milliseconds) for database operations.
- Return type:
Get the timeout of database operations for self, in milliseconds.
- get_enabled_account_services()¶
- Returns:
a list of
Accounts.AccountService
objects. When done with it, callGObject.Object.unref
() on the list elements, and g_list_free() on the container.- Return type:
Gets all the enabled account services. If the self was created for a specific service type, only services with that type will be returned.
This method causes the loading of all the service settings for all the returned accounts (unless they have been loaded previously). If you are interested in a specific account/service, consider using
Accounts.Manager.load_account
() to first load the the account, and then create theAccounts.AccountService
for that account only.
- get_provider(provider_name)¶
- Parameters:
provider_name (
str
) – the name of the provider.- Returns:
an
Accounts.Provider
, which must be free’d withAccounts.Provider.unref
() when no longer required.- Return type:
Loads the provider identified by provider_name.
- get_service(service_name)¶
- Parameters:
service_name (
str
) – the name of the service.- Returns:
an
Accounts.Service
, which must be free’d withAccounts.Service.unref
() when no longer required.- Return type:
Loads the service identified by service_name.
- get_service_type()¶
- Returns:
the name of the service type for the supplied self.
- Return type:
Get the service type for self.
- list()¶
- Returns:
a
GLib.List
of #AgAccountId representing the accounts. Must be free’d withAccounts.Manager.list_free
() when no longer required.- Return type:
[
int
]
Lists the accounts. If the
Accounts.Manager
is created with a specifiedAccounts.Manager
:service-type
, it will return only the accounts supporting this service type.
- list_applications_by_service(service)¶
- Parameters:
service (
Accounts.Service
) – theAccounts.Service
for which we want to get the applications list.- Returns:
a
GLib.List
of all the applications which have declared support for the given service or for its service type.- Return type:
Lists the registered applications which support the given service.
- list_by_service_type(service_type)¶
- Parameters:
service_type (
str
) – the name of the service type to check for.- Returns:
a
GLib.List
of #AgAccountId representing the accounts. Must be free’d withAccounts.Manager.list_free
() when no longer required.- Return type:
[
int
]
Lists the accounts supporting the given service type.
- list_enabled()¶
- Returns:
a
GLib.List
of the enabled #AgAccountId representing the accounts. Must be free’d withAccounts.Manager.list_free
() when no longer required.- Return type:
[
int
]
Lists the enabled accounts.
- list_enabled_by_service_type(service_type)¶
- Parameters:
service_type (
str
) – the name of the service type to check for.- Returns:
a
GLib.List
of the enabled #AgAccountId representing the accounts. Must be free’d withAccounts.Manager.list_free
() when no longer required.- Return type:
[
int
]
Lists the enabled accounts supporting the given service type.
- list_providers()¶
- Returns:
a list of
Accounts.Provider
, which must be then free’d withAccounts.Provider.list_free
().- Return type:
Gets a list of all the installed providers.
- list_service_types()¶
- Returns:
a list of
Accounts.ServiceType
, which must be free’d withAccounts.ServiceType.list_free
() when no longer required.- Return type:
Gets a list of all the installed service types.
- list_services()¶
- Returns:
a list of
Accounts.Service
, which must be free’d withAccounts.Service.list_free
() when no longer required.- Return type:
Gets a list of all the installed services. If the
Accounts.Manager
was created with a specified #AgManager:service_type it will return only the installed services supporting that service type.
- list_services_by_application(application)¶
- Parameters:
application (
Accounts.Application
) – aAccounts.Application
.- Returns:
a
GLib.List
ofAccounts.Service
items representing all the services which are supported. Must be free’d withAccounts.Service.list_free
().- Return type:
Get the list of services that are supported by application.
- list_services_by_type(service_type)¶
- Parameters:
service_type (
str
) – the type of the service.- Returns:
a list of
Accounts.Service
, which must be free’d withAccounts.Service.list_free
() when no longer required.- Return type:
Gets a list of all the installed services where the service type name is service_type.
- load_account(account_id)¶
- Parameters:
account_id (
int
) – the #AgAccountId of the account.- Raises:
- Returns:
an
Accounts.Account
, on which the client must callGObject.Object.unref
() when it is no longer required, orNone
if an error occurs.- Return type:
Instantiates the object representing the account identified by account_id.
- load_service_type(service_type)¶
- Parameters:
service_type (
str
) – the name of the service type.- Returns:
an
Accounts.ServiceType
, which must be free’d withAccounts.ServiceType.unref
() when no longer required.- Return type:
Instantiate the service type with the name service_type.
- set_abort_on_db_timeout(abort)¶
- Parameters:
abort (
bool
) – whether to abort when a DB timeout occurs.
Tells libaccounts whether it should make the client application abort when a timeout error occurs. The default is
False
.
- set_db_timeout(timeout_ms)¶
- Parameters:
timeout_ms (
int
) – the new timeout, in milliseconds.
Sets the timeout for database operations. This tells the library how long it is allowed to block while waiting for a locked DB to become accessible. Higher values mean a higher chance of successful reads, but also mean that the execution might be blocked for a longer time. The default is 5 seconds.
Signal Details¶
- Accounts.Manager.signals.account_created(manager, account_id)¶
- Signal Name:
account-created
- Flags:
- Parameters:
manager (
Accounts.Manager
) – The object which received the signalaccount_id (
int
) – the #AgAccountId of the account that has been created.
Emitted when a new account has been created; note that the account must have been stored in the database: the signal is not emitted just in response to
Accounts.Manager.create_account
().
- Accounts.Manager.signals.account_deleted(manager, account_id)¶
- Signal Name:
account-deleted
- Flags:
- Parameters:
manager (
Accounts.Manager
) – The object which received the signalaccount_id (
int
) – the #AgAccountId of the account that has been deleted.
Emitted when an account has been deleted. This signal is redundant with
Accounts.Account
::deleted
, but it is convenient to provide full change notification withAccounts.Manager
.
- Accounts.Manager.signals.account_updated(manager, account_id)¶
- Signal Name:
account-updated
- Flags:
- Parameters:
manager (
Accounts.Manager
) – The object which received the signalaccount_id (
int
) – the #AgAccountId of the account that has been update.
Emitted when particular service of an account has been updated. This signal is redundant with
Accounts.Account
::deleted
, but it is convenient to provide full change notification withAccounts.Manager
.
- Accounts.Manager.signals.enabled_event(manager, account_id)¶
- Signal Name:
enabled-event
- Flags:
- Parameters:
manager (
Accounts.Manager
) – The object which received the signalaccount_id (
int
) – the #AgAccountId of the account that has been enabled.
If the manager has been created with
Accounts.Manager.new_for_service_type
(), this signal will be emitted when an account (identified by account_id) has been modified in such a way that the application might be interested to start or stop using it: the “enabled” flag on the account or in some service supported by the account and matching theAccounts.Manager
:service-type
have changed. In practice, this signal might be emitted more often than when strictly needed; applications must callAccounts.Account.list_enabled_services
() orAccounts.Manager.list_enabled
() to get the current state.
Property Details¶
- Accounts.Manager.props.abort_on_db_timeout¶
-
Whether to abort the application when a database timeout occurs.
- Accounts.Manager.props.db_timeout¶
-
Timeout for database operations, in milliseconds.
- Accounts.Manager.props.service_type¶
- Name:
service-type
- Type:
- Default Value:
- Flags:
If the service type is set, certain operations on the
Accounts.Manager
, such asAccounts.Manager.list
() andAccounts.Manager.list_services
(), will be restricted to only affect accounts or services with that service type.
- Accounts.Manager.props.use_dbus¶
- Name:
use-dbus
- Type:
- Default Value:
- Flags:
Whether to use D-Bus for inter-process change notification. Setting this property to
False
causes libaccounts not to emit the change notification signals, and also not react to changes made by other processes. Disabling D-Bus is only meant to be used for specific cases, such as maintenance programs.