Devhelp.Completion

g Devhelp.Completion Devhelp.Completion GObject.Object GObject.Object GObject.Object->Devhelp.Completion

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

aggregate_complete (completion_objects, prefix)

class

new ()

add_string (str)

complete (prefix)

sort ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Devhelp.Completion(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Devhelp.CompletionClass

classmethod aggregate_complete(completion_objects, prefix)
Parameters:
Returns:

the completed prefix, or None if a longer prefix has not been found. Free with GLib.free() when no longer needed.

Return type:

str or None

The same as Devhelp.Completion.complete(), but aggregated for several Devhelp.Completion objects.

New in version 3.28.

classmethod new()
Returns:

a new Devhelp.Completion object.

Return type:

Devhelp.Completion

New in version 3.28.

add_string(str)
Parameters:

str (str) – a string.

Adds a string to the self object.

After adding all the strings you need to call Devhelp.Completion.sort().

New in version 3.28.

complete(prefix)
Parameters:

prefix (str) – the string to complete.

Returns:

the completed prefix, or None if a longer prefix has not been found. Free with GLib.free() when no longer needed.

Return type:

str or None

This function does the equivalent of:

Searches the data structure of self to find all strings that have prefix as prefix.

From the list found at step 1, find the longest prefix that still matches all the strings in the list.

This function assumes that prefix and the strings contained in self are in UTF-8. If all the strings are valid UTF-8, then the return value will also be valid UTF-8 (it won’t return a partial multi-byte character).

New in version 3.28.

sort()

Sorts all the strings. It is required to call this function after adding strings with Devhelp.Completion.add_string().

New in version 3.28.