Devhelp.Completion¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Devhelp.Completion(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod aggregate_complete(completion_objects, prefix)¶
- Parameters:
completion_objects ([
Devhelp.Completion] orNone) – aGLib.ListofDevhelp.Completionobjects.prefix (
str) – the string to complete.
- Returns:
the completed prefix, or
Noneif a longer prefix has not been found. Free withGLib.free() when no longer needed.- Return type:
The same as
Devhelp.Completion.complete(), but aggregated for severalDevhelp.Completionobjects.New in version 3.28.
- classmethod new()¶
- Returns:
a new
Devhelp.Completionobject.- Return type:
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
Noneif a longer prefix has not been found. Free withGLib.free() when no longer needed.- Return type:
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.