NM.VpnPluginInfo¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
w/co |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class NM.VpnPluginInfo(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod list_add(list, plugin_info)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – list of pluginsplugin_info (
NM.VpnPluginInfo
) – instance to add
- Raises:
- Returns:
True
if the plugin was added to list. This will fail to add duplicate plugins.- Return type:
New in version 1.2.
- classmethod list_find_by_filename(list, filename)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – list of pluginsfilename (
str
) – filename to search
- Returns:
the first plugin with a matching filename (or
None
).- Return type:
New in version 1.2.
- classmethod list_find_by_name(list, name)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – list of pluginsname (
str
) – name to search
- Returns:
the first plugin with a matching name (or
None
).- Return type:
New in version 1.2.
- classmethod list_find_by_service(list, service)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – list of pluginsservice (
str
) – service to search. This can be the main service-type or one of the provided aliases.
- Returns:
the first plugin with a matching service (or
None
).- Return type:
New in version 1.2.
- classmethod list_find_service_type(list, name)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – a possibly emptyGLib.SList
ofNM.VpnPluginInfo
instancesname (
str
) – a name to lookup the service-type.
- Returns:
the resolved service-type or
None
on failure.- Return type:
A VPN plugin provides one or several service-types, like org.freedesktop.NetworkManager.libreswan Certain plugins provide more then one service type, via aliases (org.freedesktop.NetworkManager.openswan). This function looks up a service-type (or an alias) based on a name.
Preferably, the name can be a full service-type/alias of an installed plugin. Otherwise, it can be the name of a VPN plugin (in which case, the primary, non-aliased service-type is returned). Otherwise, it can be one of several well known short-names (which is a hard-coded list of types in libnm). On success, this returns a full qualified service-type (or an alias). It doesn’t say, that such an plugin is actually available, but it could be retrieved via
NM.VpnPluginInfo.list_find_by_service
().New in version 1.4.
- classmethod list_get_service_types(list, only_existing, with_abbreviations)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – a possibly emptyGLib.SList
ofNM.VpnPluginInfo
only_existing (
bool
) – only include results that are actually in list. Otherwise, the result is extended with a hard-code list or well-known pluginswith_abbreviations (
bool
) – ifFalse
, only full service types are returned. Otherwise, this also includes abbreviated names that can be used withNM.VpnPluginInfo.list_find_service_type
().
- Returns:
a
None
terminated strv list of strings. The list itself and the values must be freed withGLib.strfreev
().- Return type:
[
str
]
New in version 1.4.
- classmethod list_load()¶
- Returns:
list of plugins loaded from the default directories rejecting duplicates.
- Return type:
New in version 1.2.
- classmethod list_remove(list, plugin_info)¶
- Parameters:
list ([
NM.VpnPluginInfo
]) – list of pluginsplugin_info (
NM.VpnPluginInfo
) – instance
- Returns:
True
if plugin_info was in list and successfully removed.- Return type:
Remove plugin_info from list.
New in version 1.2.
- classmethod new_from_file(filename)¶
- Parameters:
filename (
str
) – filename to read.- Raises:
- Returns:
None
if there is any error or a newly createdNM.VpnPluginInfo
instance.- Return type:
Read the plugin info from file filename. Does not do any further verification on the file. You might want to check file permissions and ownership of the file.
New in version 1.2.
- classmethod new_search_file(name, service)¶
- Parameters:
- Returns:
a newly created instance of plugin info or
None
if no matching value was found.- Return type:
This has the same effect as doing a full
NM.VpnPluginInfo.list_load
() followed by a search for the first matching VPN plugin info that has the given name and/or service.New in version 1.4.
- classmethod new_with_data(filename, keyfile)¶
- Parameters:
filename (
str
) – optional filename.keyfile (
GLib.KeyFile
) – inject data for the plugin info instance.
- Raises:
- Returns:
new plugin info instance.
- Return type:
This constructor does not read any data from file but takes instead a keyfile argument.
New in version 1.2.
- classmethod validate_filename(filename)¶
-
Regular name files have a certain pattern. That basically means they have the file extension “name”. Check if filename is valid according to that pattern.
New in version 1.2.
- get_auth_dialog()¶
-
New in version 1.4.
- get_editor_plugin()¶
- Returns:
the cached
NM.VpnEditorPlugin
instance.- Return type:
New in version 1.2.
- load_editor_plugin()¶
- Raises:
- Returns:
loads the plugin and returns the newly created instance. The plugin is owned by self and can be later retrieved again via
NM.VpnPluginInfo.get_editor_plugin
(). You can load the plugin only once, unless you reset the state viaNM.VpnPluginInfo.set_editor_plugin
().- Return type:
New in version 1.2.
- lookup_property(group, key)¶
- Parameters:
- Returns:
NM.VpnPluginInfo
is internally aGLib.KeyFile
. Returns the matching property.- Return type:
New in version 1.2.
- set_editor_plugin(plugin)¶
- Parameters:
plugin (
NM.VpnEditorPlugin
orNone
) – plugin instance
Set the internal plugin instance. If
None
, only clear the previous instance.New in version 1.2.
- supports_hints()¶
-
New in version 1.4.
Property Details¶
- NM.VpnPluginInfo.props.filename¶
- Name:
filename
- Type:
- Default Value:
- Flags:
The filename from which the info was loaded. Can be
None
if the instance was not loaded from a file (i.e. the keyfile instance was passed to the constructor).New in version 1.2.
- NM.VpnPluginInfo.props.keyfile¶
- Name:
keyfile
- Type:
- Default Value:
- Flags:
Initialize the instance with a different keyfile instance. When passing a keyfile instance, the constructor will not try to read from filename.
New in version 1.2.