Infinity.Browser

g GObject.GInterface GObject.GInterface Infinity.Browser Infinity.Browser GObject.GInterface->Infinity.Browser

Implementations:

None

Methods

acl_account_added (account, request)

acl_account_removed (account, request)

acl_changed (iter, sheet_set, request)

acl_local_account_changed (account, request)

add_note (iter, name, type, acl, session, initial_subscribe, func, *user_data)

add_subdirectory (iter, name, acl, func, *user_data)

begin_request (iter, request)

check_acl (iter, account, check_mask)

create_acl_account (crq, func, *user_data)

error (error)

explore (iter, func, *user_data)

get_acl (iter)

get_acl_default_account ()

get_acl_local_account ()

get_child (iter)

get_explored (iter)

get_next (iter)

get_node_name (iter)

get_node_type (iter)

get_parent (iter)

get_path (iter)

get_pending_request (iter, request_type)

get_prev (iter)

get_root ()

get_session (iter)

has_acl (iter, account)

is_ancestor (ancestor, iter)

is_subdirectory (iter)

iter_from_request (request)

list_pending_requests (iter, request_type)

lookup_acl_account_by_name (name, func, *user_data)

lookup_acl_accounts (ids, func, *user_data)

node_added (iter, request)

node_removed (iter, request)

query_acl (iter, func, *user_data)

query_acl_account_list (func, *user_data)

remove_acl_account (account, func, *user_data)

remove_node (iter, func, *user_data)

set_acl (iter, sheet_set, func, *user_data)

subscribe (iter, func, *user_data)

subscribe_session (iter, proxy, request)

unsubscribe_session (iter, proxy, request)

Virtual Methods

do_acl_account_added (account, request)

do_acl_account_removed (account, request)

do_acl_changed (iter, sheet_set, request)

do_acl_local_account_changed (account, request)

do_add_note (iter, name, type, acl, session, initial_subscribe, func, *user_data)

do_add_subdirectory (iter, name, acl, func, *user_data)

do_begin_request (iter, request)

do_create_acl_account (crq, func, *user_data)

do_error (error)

do_explore (iter, func, *user_data)

do_get_acl (iter)

do_get_acl_default_account ()

do_get_acl_local_account ()

do_get_child (iter)

do_get_explored (iter)

do_get_next (iter)

do_get_node_name (iter)

do_get_node_type (iter)

do_get_parent (iter)

do_get_prev (iter)

do_get_root ()

do_get_session (iter)

do_has_acl (iter, account)

do_is_subdirectory (iter)

do_iter_from_request (request)

do_list_pending_requests (iter, request_type)

do_lookup_acl_account_by_name (name, func, *user_data)

do_lookup_acl_accounts (ids, func, *user_data)

do_node_added (iter, request)

do_node_removed (iter, request)

do_query_acl (iter, func, *user_data)

do_query_acl_account_list (func, *user_data)

do_remove_acl_account (account, func, *user_data)

do_remove_node (iter, func, *user_data)

do_set_acl (iter, sheet_set, func, *user_data)

do_subscribe (iter, func, *user_data)

do_subscribe_session (iter, proxy, request)

do_unsubscribe_session (iter, proxy, request)

Properties

Name

Type

Flags

Short Description

status

Infinity.BrowserStatus

r

The connectivity status of the browser

Signals

Name

Short Description

acl-account-added

This signal is emitted whenever a new account is added to the browser, and the browser supports account list notification.

acl-account-removed

This signal is emitted whenever an account is removed from the browser, and the browser supports account list notification.

acl-changed

This signal is emitted whenever an ACL for the node iter points to are changed.

acl-local-account-changed

This signal is emitted whenever the account into which the local host is logged into changes.

begin-request

This signal is emitted whenever a request is made with the browser.

error

This signal is emitted whenever there was an asynchronous error with the browser itself which was not the result of a particular user request.

node-added

This signal is emitted when a node is added to the browser.

node-removed

This signal is emitted just before a node is being removed from the browser.

subscribe-session

This signal is emitted whenever the browser is subscribed to a session.

unsubscribe-session

This signal is emitted whenever a session is detached from a browser node.

Fields

None

Class Details

class Infinity.Browser
Bases:

GObject.GInterface

Structure:

Infinity.BrowserInterface

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

acl_account_added(account, request)
Parameters:

This function emits the Infinity.Browser ::acl-account-added signal on self. It is meant to be used by interface implementations only.

acl_account_removed(account, request)
Parameters:

This function emits the Infinity.Browser ::acl-account-removed signal on self. It is meant to be used by interface implementations only.

acl_changed(iter, sheet_set, request)
Parameters:

This function emits the Infinity.Browser ::acl-changed signal on self. It is meant to be used by interface implementations only.

acl_local_account_changed(account, request)
Parameters:

This function emits the Infinity.Browser ::acl-local-account-changed signal on self. It is meant to be used by interface implementations only.

add_note(iter, name, type, acl, session, initial_subscribe, func, *user_data)
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Adds a new leaf node to the browser. The new node is of type type. If session is non-None it will be used as the initial content of the new node, otherwise the new node will start empty. In the case of non-None session the session must be in status Infinity.SessionStatus.RUNNING.

The returned request finishes as soon as the creation of the node is acknowledged. It is however not guaranteed that the content of the note has been synchronized yet. In the case of a client connected to an infinote server the content is usually not transmitted when the request finishes. If an error in the process of transmission happens then the node will be removed again.

On the client side, the progress of synchronization to the server after the request has finished can be monitored with the Infinity.Session ::synchronization-failed, Infinity.Session ::synchronization-complete and Infinity.Session ::synchronization-progress signals. Note that a single session might be synchronized to multiple servers at the same time, you will have to check the connection parameter in the signal hander to find out to which server the session is synchronized.

You can safely unref session after having called this function. If the request or the synchronization fails, the session will be discarded in that case. When the returned request finishes, you can use infc_browser_iter_get_sync_in() to get the session again.

If initial_subscribe is set, then, when the returned request finishes, you might call Infinity.Browser.get_session() on the resulting Infinity.BrowserIter. However, that function is not guaranteed to return non-None in this case since the node might have been created, but the subscription could have failed.

The initial ACL for the new node is given by acl. If this parameter is None, then the default ACL is used, which inherits all permissions from the parent node. In order to apply non-None ACL to the new node, the Infinity.AclSetting.CAN_SET_ACL permission must be granted to the local entity for the node iter points to.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

add_subdirectory(iter, name, acl, func, *user_data)
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Adds a new subdirectory node to the browser.

The initial ACL for the new node is given by acl. If this parameter is None, then the default ACL is used, which inherits all permissions from the parent node. In order to apply non-None ACL to the new node, the Infinity.AclSetting.CAN_SET_ACL permission must be granted to the local entity for the node iter points to.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

begin_request(iter, request)
Parameters:

This function emits the #InfBrowser::begin_request signal on self. It is meant to be used by interface implementations only.

check_acl(iter, account, check_mask)
Parameters:
Returns:

True if all checked permissions are granted, or False otherwise.

out_mask:

Output parameter with the granted permissions, or None.

Return type:

(bool, out_mask: Infinity.AclMask)

Checks whether the given account has permissions to perform the operations specified by mask on the node iter points to. The mask parameter should have all permissions enabled that are to be checked. The function will then write those permissions that are actually granted to the mask specified by the out_mask parameter.

The function returns True if all permissions asked for are granted, i.e. when out_mask equals mask after the function call. The out_mask parameter is allowed to be None which is useful if only the return value is of interest.

In order for this function to work, the ACL sheet for account has to be available for the node iter points to and all of its parent nodes. If account is not the default or the local account, these need to be queried before using Infinity.Browser.query_acl().

If account is 0, it is assumed that local access to the directory is available and the function always returns True.

create_acl_account(crq, func, *user_data)
Parameters:
Returns:

A Infinity.Request that can be used to get notified when the request finishes or fails.

Return type:

Infinity.Request or None

Requests creation of a new account. If the request succeeds, crq will be used by the server to create a certificate which is sent back to the client and is associated to the newly created account.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

error(error)
Parameters:

error (GLib.Error) – A GLib.Error explaining what went wronig.

This function emits the Infinity.Browser ::error signal on self. It is meant to be used by interface implementations only.

explore(iter, func, *user_data)
Parameters:
Returns:

A Infinity.Request, or None if iter points to a non-subdirectory node.

Return type:

Infinity.Request or None

Requests the node iter points to to be explored. Initally, subdirectory nodes are not explored, that is not known what content there is. Nodes can be explored to learn about the children nodes they contain.is a potentially lengthy process involing networking or I/O with slow devices this function returns a InfExploreRequest which can be used to monitor the progress of the operation and get notified when the exploration finishes. During exploration Infinity.Browser ::node-added signals are already emitted appropriately for every child explored inside iter.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

New in version exploring.

get_acl(iter)
Parameters:

iter (Infinity.BrowserIter) – An iterator pointing to a node for which to retrieve ACLs.

Returns:

A Infinity.AclSheetSet containing the requested ACL, or None. The returned value is owned by the Infinity.Browser and should not be freed.

Return type:

Infinity.AclSheetSet

Retrieves the ACL for the node iter points to. This function can also be called if the ACL has not been queried before using Infinity.Browser.query_acl(). In that case, the returned sheet set will only contain sheets for the default user and the local user. The function can return None which is equivalent to an empty sheet set, i.e. no ACL.

When the full ACL has been successfully queried with Infinity.Browser.query_acl(), the full ACL is returned by this function. The function Infinity.Browser.has_acl() can be used to check whether this function will return the full ACL or only the sheets for the default and local users.

get_acl_default_account()
Returns:

A Infinity.AclAccount. The returned value is owned by the browser and must not be freed.

Return type:

Infinity.AclAccount

Returns the default Infinity.AclAccount representing unauthenticated users, and which is used to look up permissions if no permissions are explicitly specified in the ACL of a particular node for a particular account.

get_acl_local_account()
Returns:

A Infinity.AclAccount, or None. The returned value is owned by the browser and must not be freed.

Return type:

Infinity.AclAccount or None

Returns the Infinity.AclAccount representing the local host. This can be used to check whether the local account is allowed to perform certain operations in the browser. The function can also return None, in which case all operations are allowed, because the browser represents a local infinote directory.

get_child(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a subdirectory node inside self.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a subdirectory node inside self.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to the first child of the subdirectory node it currently points to. If the subdirectory does not contain any children or if iter does not point to a subdirectory the function returns False. This does not necessarily mean that there do not exist any children but it can also be that they have not yet been explored. Nodes can be explored with Infinity.Browser.explore() and it can be checked whether a given node has been explored with Infinity.Browser.get_explored().

get_explored(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a subdirectory node inside self.

Returns:

True if the node iter points to has been explored or False otherwise.

Return type:

bool

Returns whether the node iter points to has already been explored or not.

get_next(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside self.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a node inside self.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to its next sibling node. If iter points already to the last node then iter is left untouched and the function returns False.

get_node_name(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside self.

Returns:

A string containing the node’s name.

Return type:

str

Returns the name of the node iter points to.

get_node_type(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a leaf node inside self.

Returns:

The node type as a string.

Return type:

str

Returns the type of the node iter points to.

get_parent(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside self.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a node inside self.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to its parent node. If iter is already the root node then iter is left untouched and the function returns False.

get_path(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside self.

Returns:

The path as a string. Free with GLib.free() when no longer needed.

Return type:

str

Returns the full path to the node iter points to. A path always starts with a ‘/’ and then has the name of the node and all its parents separated by ‘/’, much like a filesystem path on Unix.

get_pending_request(iter, request_type)
Parameters:
Returns:

A Infinity.Request, or None.

Return type:

Infinity.Request or None

Returns a pending request for the node iter points to which matches type request_type. If there is no such request the function returns None. This function is a shortcut for calling Infinity.Browser.list_pending_requests() and retrieving the first item from the list.

If iter is None the function returns a global request.

For many request types, such as “subscribe-session”, “subscribe-chat”, “explore-node”, “query-user-list” or “query-acl” there can only be one request at a time, and therefore this function is more convenient to use than Infinity.Browser.list_pending_requests().

get_prev(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside self.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a node inside self.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to its previous sibling node. If iter points to the first node already then iter is left untouched and the function returns False.

get_root()
Returns:

True if iter was set or False if there is no root node, i.e. the browser is not open.

iter:

An uninitialized Infinity.BrowserIter.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to the root node of self.

get_session(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a leaf node inside self.

Returns:

A InfSessionProxy which contains the session. The proxy object can be used to join a user into the session.

Return type:

Infinity.SessionProxy or None

Returns the session which has the content of the node iter points to. The session needs to be subscribed to, see Infinity.Browser.subscribe(). If the session is not subscribed or the subscription request has not yet finished the function returns None.

has_acl(iter, account)
Parameters:
  • iter (Infinity.BrowserIter) – An iterator pointing to a node for which to check full ACL availability.

  • account (int) – The account to check ACL availability for, or 0.

Returns:

True when the ACL sheet for account is available or False otherwise.

Return type:

bool

This function returns whether the ACL sheet for the given account is available or not. If the function returns False then Infinity.Browser.query_acl() can be called in order to retrieve the full ACL. If account is 0, the function checks whether the full ACL is available, i.e. the ACL sheets for all accounts. Usually the ACL sheets for the default account and the local account are always available.

is_ancestor(ancestor, iter)
Parameters:
Returns:

Whether ancestor is an ancestor of iter.

Return type:

bool

Returns whether ancestor is an ancestor of iter, i.e. either the two iterators point to the same node or ancestor is a parent, grand-parent, grand-grand-parent, etc. of the node iter points to.

is_subdirectory(iter)
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside self.

Returns:

True if the node iter points to is a subdirectory node or False otherwise.

Return type:

bool

Returns whether the node iter points to is a subdirectory node.

iter_from_request(request)
Parameters:

request (Infinity.Request) – A Infinity.Request which has not yet finished and which was issued by self.

Returns:

True if iter was moved or False otherwise.

iter:

An uninitialized Infinity.BrowserIter.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to the node for which request was made. If that node does not exist anymore or if request has already finished the function returns False and iter is left untouched.

list_pending_requests(iter, request_type)
Parameters:
Returns:

A list of Infinity.Request s. Free with g_slist_free() when no longer needed.

Return type:

[Infinity.Request]

Returns a list of all pending requests for the node iter points to which match type request_type. A pending request is a request which has been created but has not yet finished. request_type can be None in which case all requests for the given node are returned. If it is non-None only requests which match the given type are included in the list of returned requests.

If iter is None then the function returns all pending global requests.

lookup_acl_account_by_name(name, func, *user_data)
Parameters:
  • name (str) – The name of the user account to look up.

  • func (Infinity.RequestFunc) – The function to be called when the request finishes, or None.

  • user_data (object or None) – Additional data to pass to func.

Returns:

A Infinity.Request that can be used to be notified when the request finishes, or None.

Return type:

Infinity.Request or None

Looks up the account(s) with the given name. While in principal, there can be many accounts with the same name, in practise user names are often unique.

The request result contains an array of Infinity.AclAccount objects, all with the same name. If there is only one entry with ID set to 0, there are no accounts with the given name.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

lookup_acl_accounts(ids, func, *user_data)
Parameters:
  • ids ([int]) – An array of account IDs to look up.

  • func (Infinity.RequestFunc) – The function to be called when the request finishes, or None.

  • user_data (object or None) – Additional data to pass to func.

Returns:

A Infinity.Request that can be used to be notified when the request finishes, or None.

Return type:

Infinity.Request or None

Looks up the accounts with the given IDs. If the account list has been queried with Infinity.Browser.query_acl_account_list() before, then it is likely that this function returns instantly, otherwise an asynchronous operation might be started.

The request result contains an array of Infinity.AclAccount objects for the given account IDs, which contain the account names as well. If one account ID does not belong to an actual account, the Infinity.AclAccount.name field will be None.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

node_added(iter, request)
Parameters:

This function emits the Infinity.Browser ::node-added signal on self. It is meant to be used by interface implementations only.

node_removed(iter, request)
Parameters:

This function emits the Infinity.Browser ::node-removed signal on self. It is meant to be used by interface implementations only.

query_acl(iter, func, *user_data)
Parameters:
Returns:

A Infinity.Request which can be used to be notified when the request finishes.

Return type:

Infinity.Request or None

Queries the ACLs for all users of the node iter points to. When the request has finished, Infinity.Browser.get_acl() can be used to retrieve the ACLs.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

query_acl_account_list(func, *user_data)
Parameters:
Returns:

A Infinity.Request that can be used to be notified when the request finishes, or None.

Return type:

Infinity.Request or None

Queries the list of accounts in self. When this call has finished, a list of accounts is available, and also a flag whether the browser supports notification of accounts. If it does, then the Infinity.Browser ::acl-account-added and Infinity.Browser ::acl-account-removed signals are emitted when the account list changes, and the next time this function is called, it might be available to serve the account list from the cache without blocking.

It can also be that the browser does not support listing of accounts at all. In this case, the request will fail with an error code of Infinity.DirectoryError.OPERATION_UNSUPPORTED.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

remove_acl_account(account, func, *user_data)
Parameters:
  • account (int) – The ID of the account to remove.

  • func (Infinity.RequestFunc) – The function to be called when the request finishes, or None.

  • user_data (object or None) – Additional data to pass to func.

Returns:

A Infinity.Request that can be used to get notified when the request finishes or fails.

Return type:

Infinity.Request or None

Requests deletion of the given account.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

remove_node(iter, func, *user_data)
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Requests to remove the node iter points to. It may point to a subdirectory node in which case all its children are removed recursively as well.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

set_acl(iter, sheet_set, func, *user_data)
Parameters:
Returns:

A Infinity.Request which can be used to be notified when the request finishes.

Return type:

Infinity.Request or None

Changes the ACLs for the node iter points to. Existing sheets that are not in sheet_set are left untouched. This operation is only allowed when the ACL for the node iter points to has been retrieved already with Infinity.Browser.query_acl(). Use Infinity.Browser.has_acl() to check whether this function can be called or whether the ACL needs to be queried first.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

subscribe(iter, func, *user_data)
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Attempts to subscribe to the node iter points to, i.e. obtain a Infinity.Session representing its content. This also allows to change the content of the node.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

subscribe_session(iter, proxy, request)
Parameters:

This function emits the Infinity.Browser ::subscribe-session signal on self. It is meant to be used by interface implementations only.

unsubscribe_session(iter, proxy, request)
Parameters:

This function emits the Infinity.Browser ::unsubscribe-session signal on self. It is meant to be used by interface implementations only.

do_acl_account_added(account, request) virtual
Parameters:

This function emits the Infinity.Browser ::acl-account-added signal on browser. It is meant to be used by interface implementations only.

do_acl_account_removed(account, request) virtual
Parameters:

This function emits the Infinity.Browser ::acl-account-removed signal on browser. It is meant to be used by interface implementations only.

do_acl_changed(iter, sheet_set, request) virtual
Parameters:

This function emits the Infinity.Browser ::acl-changed signal on browser. It is meant to be used by interface implementations only.

do_acl_local_account_changed(account, request) virtual
Parameters:

This function emits the Infinity.Browser ::acl-local-account-changed signal on browser. It is meant to be used by interface implementations only.

do_add_note(iter, name, type, acl, session, initial_subscribe, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Adds a new leaf node to the browser. The new node is of type type. If session is non-None it will be used as the initial content of the new node, otherwise the new node will start empty. In the case of non-None session the session must be in status Infinity.SessionStatus.RUNNING.

The returned request finishes as soon as the creation of the node is acknowledged. It is however not guaranteed that the content of the note has been synchronized yet. In the case of a client connected to an infinote server the content is usually not transmitted when the request finishes. If an error in the process of transmission happens then the node will be removed again.

On the client side, the progress of synchronization to the server after the request has finished can be monitored with the Infinity.Session ::synchronization-failed, Infinity.Session ::synchronization-complete and Infinity.Session ::synchronization-progress signals. Note that a single session might be synchronized to multiple servers at the same time, you will have to check the connection parameter in the signal hander to find out to which server the session is synchronized.

You can safely unref session after having called this function. If the request or the synchronization fails, the session will be discarded in that case. When the returned request finishes, you can use infc_browser_iter_get_sync_in() to get the session again.

If initial_subscribe is set, then, when the returned request finishes, you might call Infinity.Browser.get_session() on the resulting Infinity.BrowserIter. However, that function is not guaranteed to return non-None in this case since the node might have been created, but the subscription could have failed.

The initial ACL for the new node is given by acl. If this parameter is None, then the default ACL is used, which inherits all permissions from the parent node. In order to apply non-None ACL to the new node, the Infinity.AclSetting.CAN_SET_ACL permission must be granted to the local entity for the node iter points to.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_add_subdirectory(iter, name, acl, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Adds a new subdirectory node to the browser.

The initial ACL for the new node is given by acl. If this parameter is None, then the default ACL is used, which inherits all permissions from the parent node. In order to apply non-None ACL to the new node, the Infinity.AclSetting.CAN_SET_ACL permission must be granted to the local entity for the node iter points to.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_begin_request(iter, request) virtual
Parameters:

This function emits the #InfBrowser::begin_request signal on browser. It is meant to be used by interface implementations only.

do_create_acl_account(crq, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request that can be used to get notified when the request finishes or fails.

Return type:

Infinity.Request or None

Requests creation of a new account. If the request succeeds, crq will be used by the server to create a certificate which is sent back to the client and is associated to the newly created account.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_error(error) virtual
Parameters:

error (GLib.Error) – A GLib.Error explaining what went wronig.

This function emits the Infinity.Browser ::error signal on browser. It is meant to be used by interface implementations only.

do_explore(iter, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request, or None if iter points to a non-subdirectory node.

Return type:

Infinity.Request or None

Requests the node iter points to to be explored. Initally, subdirectory nodes are not explored, that is not known what content there is. Nodes can be explored to learn about the children nodes they contain.is a potentially lengthy process involing networking or I/O with slow devices this function returns a InfExploreRequest which can be used to monitor the progress of the operation and get notified when the exploration finishes. During exploration Infinity.Browser ::node-added signals are already emitted appropriately for every child explored inside iter.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

New in version exploring.

do_get_acl(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – An iterator pointing to a node for which to retrieve ACLs.

Returns:

A Infinity.AclSheetSet containing the requested ACL, or None. The returned value is owned by the Infinity.Browser and should not be freed.

Return type:

Infinity.AclSheetSet

Retrieves the ACL for the node iter points to. This function can also be called if the ACL has not been queried before using Infinity.Browser.query_acl(). In that case, the returned sheet set will only contain sheets for the default user and the local user. The function can return None which is equivalent to an empty sheet set, i.e. no ACL.

When the full ACL has been successfully queried with Infinity.Browser.query_acl(), the full ACL is returned by this function. The function Infinity.Browser.has_acl() can be used to check whether this function will return the full ACL or only the sheets for the default and local users.

do_get_acl_default_account() virtual
Returns:

A Infinity.AclAccount. The returned value is owned by the browser and must not be freed.

Return type:

Infinity.AclAccount

Returns the default Infinity.AclAccount representing unauthenticated users, and which is used to look up permissions if no permissions are explicitly specified in the ACL of a particular node for a particular account.

do_get_acl_local_account() virtual
Returns:

A Infinity.AclAccount, or None. The returned value is owned by the browser and must not be freed.

Return type:

Infinity.AclAccount or None

Returns the Infinity.AclAccount representing the local host. This can be used to check whether the local account is allowed to perform certain operations in the browser. The function can also return None, in which case all operations are allowed, because the browser represents a local infinote directory.

do_get_child(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a subdirectory node inside browser.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a subdirectory node inside browser.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to the first child of the subdirectory node it currently points to. If the subdirectory does not contain any children or if iter does not point to a subdirectory the function returns False. This does not necessarily mean that there do not exist any children but it can also be that they have not yet been explored. Nodes can be explored with Infinity.Browser.explore() and it can be checked whether a given node has been explored with Infinity.Browser.get_explored().

do_get_explored(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a subdirectory node inside browser.

Returns:

True if the node iter points to has been explored or False otherwise.

Return type:

bool

Returns whether the node iter points to has already been explored or not.

do_get_next(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside browser.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a node inside browser.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to its next sibling node. If iter points already to the last node then iter is left untouched and the function returns False.

do_get_node_name(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside browser.

Returns:

A string containing the node’s name.

Return type:

str

Returns the name of the node iter points to.

do_get_node_type(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a leaf node inside browser.

Returns:

The node type as a string.

Return type:

str

Returns the type of the node iter points to.

do_get_parent(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside browser.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a node inside browser.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to its parent node. If iter is already the root node then iter is left untouched and the function returns False.

do_get_prev(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside browser.

Returns:

True if iter was moved or False otherwise.

iter:

A Infinity.BrowserIter pointing to a node inside browser.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to its previous sibling node. If iter points to the first node already then iter is left untouched and the function returns False.

do_get_root() virtual
Returns:

True if iter was set or False if there is no root node, i.e. the browser is not open.

iter:

An uninitialized Infinity.BrowserIter.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to point to the root node of browser.

do_get_session(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a leaf node inside browser.

Returns:

A InfSessionProxy which contains the session. The proxy object can be used to join a user into the session.

Return type:

Infinity.SessionProxy or None

Returns the session which has the content of the node iter points to. The session needs to be subscribed to, see Infinity.Browser.subscribe(). If the session is not subscribed or the subscription request has not yet finished the function returns None.

do_has_acl(iter, account) virtual
Parameters:
  • iter (Infinity.BrowserIter) – An iterator pointing to a node for which to check full ACL availability.

  • account (int) – The account to check ACL availability for, or 0.

Returns:

True when the ACL sheet for account is available or False otherwise.

Return type:

bool

This function returns whether the ACL sheet for the given account is available or not. If the function returns False then Infinity.Browser.query_acl() can be called in order to retrieve the full ACL. If account is 0, the function checks whether the full ACL is available, i.e. the ACL sheets for all accounts. Usually the ACL sheets for the default account and the local account are always available.

do_is_subdirectory(iter) virtual
Parameters:

iter (Infinity.BrowserIter) – A Infinity.BrowserIter pointing to a node inside browser.

Returns:

True if the node iter points to is a subdirectory node or False otherwise.

Return type:

bool

Returns whether the node iter points to is a subdirectory node.

do_iter_from_request(request) virtual
Parameters:

request (Infinity.Request) – A Infinity.Request which has not yet finished and which was issued by browser.

Returns:

True if iter was moved or False otherwise.

iter:

An uninitialized Infinity.BrowserIter.

Return type:

(bool, iter: Infinity.BrowserIter)

Sets iter to the node for which request was made. If that node does not exist anymore or if request has already finished the function returns False and iter is left untouched.

do_list_pending_requests(iter, request_type) virtual
Parameters:
Returns:

A list of Infinity.Request s. Free with g_slist_free() when no longer needed.

Return type:

[Infinity.Request]

Returns a list of all pending requests for the node iter points to which match type request_type. A pending request is a request which has been created but has not yet finished. request_type can be None in which case all requests for the given node are returned. If it is non-None only requests which match the given type are included in the list of returned requests.

If iter is None then the function returns all pending global requests.

do_lookup_acl_account_by_name(name, func, *user_data) virtual
Parameters:
  • name (str) – The name of the user account to look up.

  • func (Infinity.RequestFunc) – The function to be called when the request finishes, or None.

  • user_data (object or None) – Additional data to pass to func.

Returns:

A Infinity.Request that can be used to be notified when the request finishes, or None.

Return type:

Infinity.Request or None

Looks up the account(s) with the given name. While in principal, there can be many accounts with the same name, in practise user names are often unique.

The request result contains an array of Infinity.AclAccount objects, all with the same name. If there is only one entry with ID set to 0, there are no accounts with the given name.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_lookup_acl_accounts(ids, func, *user_data) virtual
Parameters:
  • ids ([int]) – An array of account IDs to look up.

  • func (Infinity.RequestFunc) – The function to be called when the request finishes, or None.

  • user_data (object or None) – Additional data to pass to func.

Returns:

A Infinity.Request that can be used to be notified when the request finishes, or None.

Return type:

Infinity.Request or None

Looks up the accounts with the given IDs. If the account list has been queried with Infinity.Browser.query_acl_account_list() before, then it is likely that this function returns instantly, otherwise an asynchronous operation might be started.

The request result contains an array of Infinity.AclAccount objects for the given account IDs, which contain the account names as well. If one account ID does not belong to an actual account, the Infinity.AclAccount.name field will be None.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_node_added(iter, request) virtual
Parameters:

This function emits the Infinity.Browser ::node-added signal on browser. It is meant to be used by interface implementations only.

do_node_removed(iter, request) virtual
Parameters:

This function emits the Infinity.Browser ::node-removed signal on browser. It is meant to be used by interface implementations only.

do_query_acl(iter, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request which can be used to be notified when the request finishes.

Return type:

Infinity.Request or None

Queries the ACLs for all users of the node iter points to. When the request has finished, Infinity.Browser.get_acl() can be used to retrieve the ACLs.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_query_acl_account_list(func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request that can be used to be notified when the request finishes, or None.

Return type:

Infinity.Request or None

Queries the list of accounts in browser. When this call has finished, a list of accounts is available, and also a flag whether the browser supports notification of accounts. If it does, then the Infinity.Browser ::acl-account-added and Infinity.Browser ::acl-account-removed signals are emitted when the account list changes, and the next time this function is called, it might be available to serve the account list from the cache without blocking.

It can also be that the browser does not support listing of accounts at all. In this case, the request will fail with an error code of Infinity.DirectoryError.OPERATION_UNSUPPORTED.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_remove_acl_account(account, func, *user_data) virtual
Parameters:
  • account (int) – The ID of the account to remove.

  • func (Infinity.RequestFunc) – The function to be called when the request finishes, or None.

  • user_data (object or None) – Additional data to pass to func.

Returns:

A Infinity.Request that can be used to get notified when the request finishes or fails.

Return type:

Infinity.Request or None

Requests deletion of the given account.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_remove_node(iter, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Requests to remove the node iter points to. It may point to a subdirectory node in which case all its children are removed recursively as well.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_set_acl(iter, sheet_set, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request which can be used to be notified when the request finishes.

Return type:

Infinity.Request or None

Changes the ACLs for the node iter points to. Existing sheets that are not in sheet_set are left untouched. This operation is only allowed when the ACL for the node iter points to has been retrieved already with Infinity.Browser.query_acl(). Use Infinity.Browser.has_acl() to check whether this function can be called or whether the ACL needs to be queried first.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_subscribe(iter, func, *user_data) virtual
Parameters:
Returns:

A Infinity.Request which can be used to get notified when the request finishes.

Return type:

Infinity.Request or None

Attempts to subscribe to the node iter points to, i.e. obtain a Infinity.Session representing its content. This also allows to change the content of the node.

The request might either finish during the call to this function, in which case func will be called and None being returned. If the request does not finish within the function call, a Infinity.Request object is returned, where func has been installed for the Infinity.Request ::finished signal, so that it is called as soon as the request finishes.

do_subscribe_session(iter, proxy, request) virtual
Parameters:

This function emits the Infinity.Browser ::subscribe-session signal on browser. It is meant to be used by interface implementations only.

do_unsubscribe_session(iter, proxy, request) virtual
Parameters:

This function emits the Infinity.Browser ::unsubscribe-session signal on browser. It is meant to be used by interface implementations only.

Signal Details

Infinity.Browser.signals.acl_account_added(browser, account, request)
Signal Name:

acl-account-added

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a new account is added to the browser, and the browser supports account list notification.

Infinity.Browser.signals.acl_account_removed(browser, account, request)
Signal Name:

acl-account-removed

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever an account is removed from the browser, and the browser supports account list notification.

Infinity.Browser.signals.acl_changed(browser, iter, sheet_set, request)
Signal Name:

acl-changed

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever an ACL for the node iter points to are changed. This signal is emitted whenever the ACL change for the local user, the default user, or for a node that all ACLs have been queried with Infinity.Browser.query_acl().

The sheet_set parameter contains only the ACL sheets that have changed. In order to get the new full sheet set, call Infinity.Browser.get_acl().

Infinity.Browser.signals.acl_local_account_changed(browser, account, request)
Signal Name:

acl-local-account-changed

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever the account into which the local host is logged into changes. This can happen for example on a delayed login, or when the current account is deleted from the server in which case the host is demoted to the default account.

Infinity.Browser.signals.begin_request(browser, iter, request)
Signal Name:

begin-request

Flags:

RUN_LAST, DETAILED

Parameters:

This signal is emitted whenever a request is made with the browser. The signal is detailed with the request type, so that it is possible to connect to e.g. “begin-request::add-subdirectory” to only get notified about subdirectory creation requests.

If iter is None the request is a global request and not attached to a particular node.

Infinity.Browser.signals.error(browser, error)
Signal Name:

error

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever there was an asynchronous error with the browser itself which was not the result of a particular user request. The error may or may not be fatal. If it is fatal the browser will also be closed which can be checked with the status property.

Infinity.Browser.signals.node_added(browser, iter, request)
Signal Name:

node-added

Flags:

RUN_LAST

Parameters:

This signal is emitted when a node is added to the browser.

Infinity.Browser.signals.node_removed(browser, iter, request)
Signal Name:

node-removed

Flags:

RUN_LAST

Parameters:

This signal is emitted just before a node is being removed from the browser. The iterator is still valid and can be used to access the node which will be removed.

Infinity.Browser.signals.subscribe_session(browser, iter, session, request)
Signal Name:

subscribe-session

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever the browser is subscribed to a session. This can happen as a result of a Infinity.Browser.subscribe() or Infinity.Browser.add_note() call, but it is also possible that a subscription is initiated without user interaction.

If iter is None the session was a global session and not attached to a particular node.

Infinity.Browser.signals.unsubscribe_session(browser, iter, session, request)
Signal Name:

unsubscribe-session

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a session is detached from a browser node. This can happen when a subscribed session is closed, or, in the case of a server, if the session is idle for a long time it is stored on disk and removed from memory.

Note that this signal does not mean that the corresponding session can no longer be used. It only means that it is no longer associated to a browser node, for example also when the browser node is deleted. The session might still be intact, though, and can continue even when it is detached from the browser.

In order to find out whether the local host was unsubscribed from a session and the connection to the other session participants has been lost, the Infinity.Session :subscription-group property should be monitored, and if that property changes and Infinity.Session.get_subscription_group() returns None afterwards, it means the session is no longer connected.

If iter is None the session was a global session and not attached to a particular node.

Property Details

Infinity.Browser.props.status
Name:

status

Type:

Infinity.BrowserStatus

Default Value:

Infinity.BrowserStatus.CLOSED

Flags:

READABLE

The connectivity status of the browser