EBackend.ServerSideSource¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | EDataServer.Source (83), GObject.Object (37), Gio.Initable (2), Gio.ProxyResolver (5) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | get_user_dir() | 
| class | new(server, file) | 
| class | new_memory_only(server, uid) | 
| class | new_user_file(uid) | 
| class | uid_from_file(file) | 
| get_exported() | |
| get_file() | |
| get_node() | |
| get_server() | |
| get_write_directory() | |
| load(cancellable) | |
| ref_oauth2_support() | |
| set_oauth2_support(oauth2_support) | |
| set_remote_creatable(remote_creatable) | |
| set_remote_deletable(remote_deletable) | |
| set_removable(removable) | |
| set_writable(writable) | |
| set_write_directory(write_directory) | 
Virtual Methods¶
| Inherited: | EDataServer.Source (21), GObject.Object (7), Gio.Initable (1), Gio.ProxyResolver (4) | 
|---|
Properties¶
| Inherited: | EDataServer.Source (10) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| exported | bool | r | Whether the source has been exported over D-Bus | 
| file | Gio.File | r/w/co | The key file for the data source | 
| oauth2-support | EBackend.OAuth2Support | r/w/en | The object providing OAuth 2.0 support | 
| server | EBackend.SourceRegistryServer | r/w/co | The server to which the data source belongs | 
| write-directory | str | r/w/en | Directory in which to write changes to disk | 
Signals¶
| Inherited: | EDataServer.Source (3), GObject.Object (1) | 
|---|
Fields¶
| Inherited: | EDataServer.Source (3), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | EDataServer.Source | r | 
Class Details¶
- 
class EBackend.ServerSideSource(**kwargs)¶
- Bases: - EDataServer.Source- Abstract: - No - Structure: - EBackend.ServerSideSourceClass- Contains only private data that should be read and manipulated using the functions below. - New in version 3.6. - 
classmethod get_user_dir()¶
- Returns: - the user-specific data source directory - Return type: - str- Returns the directory where user-specific data source files are stored. - New in version 3.6. 
 - 
classmethod new(server, file)¶
- Parameters: - server (EBackend.SourceRegistryServer) – anEBackend.SourceRegistryServer
- file (Gio.File) – aGio.File, orNone
 - Raises: - Returns: - a new - EBackend.ServerSideSource, or- None- Return type: - Creates a new - EBackend.ServerSideSourcewhich belongs to server. If file is non-- Noneand points to an existing file, the- EBackend.ServerSideSourceis initialized from the file content. If a read error occurs or the file contains syntax errors, the function sets error and returns- None.- New in version 3.6. 
- server (
 - 
classmethod new_memory_only(server, uid)¶
- Parameters: - server (EBackend.SourceRegistryServer) – anEBackend.SourceRegistryServer
- uid (str) – a unique identifier, orNone
 - Raises: - Returns: - a new memory-only - EBackend.ServerSideSource, or- None- Return type: - Creates a memory-only - EBackend.ServerSideSourcewhich belongs to server. No on-disk key file is created for this data source, so it will not be remembered across sessions.- Data source collections are often populated with memory-only data sources to serve as proxies for resources discovered on a remote server. These data sources are usually neither - EBackend.ServerSideSource- :writablenor- EBackend.ServerSideSource- :removableby clients, at least not directly.- If an error occurs while instantiating the - EBackend.ServerSideSource, the function sets error and returns- None. Although at this time there are no known error conditions for memory-only data sources.- New in version 3.6. 
- server (
 - 
classmethod new_user_file(uid)¶
- Parameters: - uid ( - str) – unique identifier for a data source, or- None- Returns: - the - Gio.Filefor a new data source- Return type: - Gio.File- Generates a unique file name for a new user-specific data source. If uid is non- - Noneit will be used in the basename of the file, otherwise a unique basename will be generated using- EDataServer.util_generate_uid().- The returned - Gio.Filecan then be passed to- EBackend.ServerSideSource.new(). Unreference the- Gio.Filewith- GObject.Object.unref() when finished with it.- Note the data source file itself is not created here, only its name. - New in version 3.6. 
 - 
classmethod uid_from_file(file)¶
- Parameters: - file ( - Gio.File) – a- Gio.Filefor a data source- Raises: - GLib.Error- Returns: - the unique identity string for file, or - None- Return type: - str- Extracts a unique identity string from the base name of file. If the base name of file is missing a ‘.source’ extension, the function sets error and returns - None.- New in version 3.6. 
 - 
get_exported()¶
- Returns: - whether self has been exported - Return type: - bool- Returns whether self has been exported over D-Bus. - The function returns - Falseafter self is initially created,- Trueafter passing self uid to- EBackend.SourceRegistryServer.ref_source() (provided that self’s- EDataServer.Source- :parentis also exported).- New in version 3.6. 
 - 
get_file()¶
- Returns: - the - Gio.Filefor self, or- None- Return type: - Gio.Fileor- None- Returns the - Gio.Filefrom which data source content is loaded and to which changes are saved. Note the self may not have a- Gio.File.- New in version 3.6. 
 - 
get_node()¶
- Returns: - a - GLib.Node, or- None- Return type: - GLib.Nodeor- None- Returns the - GLib.Noderepresenting the self’s hierarchical placement, or- Noneif self has not been placed in the data source hierarchy. The data member of the- GLib.Nodepoints back to self. This is an easy way to traverse ancestor and descendant data sources.- Note that accessing other data sources this way is not thread-safe, and this therefore function may be replaced at some later date. - New in version 3.6. 
 - 
get_server()¶
- Returns: - the - EBackend.SourceRegistryServerfor self- Return type: - EBackend.SourceRegistryServer- Returns the - EBackend.SourceRegistryServerto which self belongs.- New in version 3.6. 
 - 
get_write_directory()¶
- Returns: - the directory where changes are written - Return type: - str- Returns the local directory path where changes to self are written. - By default, changes are written to the local directory path returned by - EBackend.ServerSideSource.get_user_dir(), but an- EBackend.CollectionBackendmay wish to override this to use its own private cache directory for data sources it creates automatically.- New in version 3.6. 
 - 
load(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Reloads data source content from the file pointed to by the - EBackend.ServerSideSource- :fileproperty.- If the - EBackend.ServerSideSource- :fileproperty is- Noneor the file it points to does not exist, the function does nothing and returns- True.- If a read error occurs or the file contains syntax errors, the function sets error and returns - False.- New in version 3.6. 
 - 
ref_oauth2_support()¶
- Returns: - an - EBackend.OAuth2Supportobject, or- None- Return type: - EBackend.OAuth2Supportor- None- Returns the object implementing the - EBackend.OAuth2SupportInterface, or- Noneif self does not support OAuth 2.0 authentication.- The returned - EBackend.OAuth2Supportobject is referenced for thread-safety. Unreference the object with- GObject.Object.unref() when finished with it.- New in version 3.8. 
 - 
set_oauth2_support(oauth2_support)¶
- Parameters: - oauth2_support ( - EBackend.OAuth2Support) – an- EBackend.OAuth2Supportobject, or- None- Indicates whether self supports OAuth 2.0 authentication. - If oauth2_support is non- - None, the OAuth2Support D-Bus interface is exported at the object path for self. If oauth2_support is- None, the OAuth2Support D-Bus interface is unexported at the object path for self, and any attempt by clients to call- EDataServer.Source.get_oauth2_access_token() will fail.- Requests for OAuth 2.0 access tokens are forwarded to oauth2_support, which implements the - EBackend.OAuth2SupportInterface.- New in version 3.8. 
 - 
set_remote_creatable(remote_creatable)¶
- Parameters: - remote_creatable ( - bool) – whether to export the RemoteCreatable interface- Indicates whether self can be used to create resources on a remote server. Typically this is only set to - Truefor collection sources.- If - True, the RemoteCreatable D-Bus interface is exported at the object path for self. If- False, the RemoteCreatable D-Bus interface is unexported at the object path for self, and any attempt by clients to call- EDataServer.Source.remote_create() will fail.- Unlike the - EDataServer.Source- :removableand- EDataServer.Source- :writableproperties, this is enforced for both clients of the registry D-Bus service and within the registry D-Bus service itself.- New in version 3.6. 
 - 
set_remote_deletable(remote_deletable)¶
- Parameters: - remote_deletable ( - bool) – whether to export the RemoteDeletable interface- Indicates whether self can be used to delete resources on a remote server. Typically this is only set to - Truefor sources created by an- EBackend.CollectionBackendto represent a remote resource.- If - True, the RemoteDeletable D-Bus interface is exported at the object path for self. If- False, the RemoteDeletable D-Bus interface is unexported at the object path for self, and any attempt by clients to call- EDataServer.Source.remote_delete() will fail.- Unlike the - EDataServer.Source- :removableand- EDataServer.Source- :writableproperties, this is enforced for both clients of the registry D-Bus server and within the registry D-Bus service itself.- New in version 3.6. 
 - 
set_removable(removable)¶
- Parameters: - removable ( - bool) – whether to export the Removable interface- Sets whether to allow registry clients to remove self and its descendants. If - True, the Removable D-Bus interface is exported at the object path for self. If- False, the Removable D-Bus interface is unexported at the object path for self, and any attempt by clients to call- EDataServer.Source.remove() will fail.- Note this is only enforced for clients of the registry D-Bus service. The service itself may remove any data source at any time. - New in version 3.6. 
 - 
set_writable(writable)¶
- Parameters: - writable ( - bool) – whether to export the Writable interface- Sets whether to allow registry clients to alter the content of self. If - True, the Writable D-Bus interface is exported at the object path for self. If- False, the Writable D-Bus interface is unexported at the object path for self, and any attempt by clients to call- EDataServer.Source.write() will fail.- Note this is only enforced for clients of the registry D-Bus service. The service itself can write to any data source at any time. - New in version 3.6. 
 - 
set_write_directory(write_directory)¶
- Parameters: - write_directory ( - str) – the directory where changes are to be written- Sets the local directory path where changes to self are to be written. - By default, changes are written to the local directory path returned by - EBackend.ServerSideSource.get_user_dir(), but an- EBackend.CollectionBackendmay wish to override this to use its own private cache directory for data sources it creates automatically.- New in version 3.6. 
 
- 
classmethod 
Property Details¶
- 
EBackend.ServerSideSource.props.exported¶
- Name: - exported- Type: - bool- Default Value: - False- Flags: - READABLE- Whether the source has been exported over D-Bus 
- 
EBackend.ServerSideSource.props.file¶
- Name: - file- Type: - Gio.File- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The key file for the data source 
- 
EBackend.ServerSideSource.props.oauth2_support¶
- Name: - oauth2-support- Type: - EBackend.OAuth2Support- Default Value: - None- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The object providing OAuth 2.0 support 
- 
EBackend.ServerSideSource.props.server¶
- Name: - server- Type: - EBackend.SourceRegistryServer- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The server to which the data source belongs