NM.VpnPluginInfo

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object NM.VpnPluginInfo NM.VpnPluginInfo GObject.Object->NM.VpnPluginInfo Gio.Initable->NM.VpnPluginInfo

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

list_add (list, plugin_info)

class

list_find_by_filename (list, filename)

class

list_find_by_name (list, name)

class

list_find_by_service (list, service)

class

list_find_service_type (list, name)

class

list_get_service_types (list, only_existing, with_abbreviations)

class

list_load ()

class

list_remove (list, plugin_info)

class

new_from_file (filename)

class

new_search_file (name, service)

class

new_with_data (filename, keyfile)

class

validate_filename (filename)

get_aliases ()

get_auth_dialog ()

get_editor_plugin ()

get_filename ()

get_name ()

get_plugin ()

get_program ()

get_service ()

load_editor_plugin ()

lookup_property (group, key)

set_editor_plugin (plugin)

supports_hints ()

supports_multiple ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

Properties

Name

Type

Flags

Short Description

filename

str

r/w/co

keyfile

GLib.KeyFile

w/co

name

str

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.VpnPluginInfo(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

No

Structure:

NM.VpnPluginInfoClass

classmethod list_add(list, plugin_info)
Parameters:
Raises:

GLib.Error

Returns:

True if the plugin was added to list. This will fail to add duplicate plugins.

Return type:

bool

New in version 1.2.

classmethod list_find_by_filename(list, filename)
Parameters:
Returns:

the first plugin with a matching filename (or None).

Return type:

NM.VpnPluginInfo

New in version 1.2.

classmethod list_find_by_name(list, name)
Parameters:
Returns:

the first plugin with a matching name (or None).

Return type:

NM.VpnPluginInfo

New in version 1.2.

classmethod list_find_by_service(list, service)
Parameters:
  • list ([NM.VpnPluginInfo]) – list of plugins

  • service (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:

NM.VpnPluginInfo

New in version 1.2.

classmethod list_find_service_type(list, name)
Parameters:
Returns:

the resolved service-type or None on failure.

Return type:

str

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:
Returns:

a None terminated strv list of strings. The list itself and the values must be freed with GLib.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:

[NM.VpnPluginInfo]

New in version 1.2.

classmethod list_remove(list, plugin_info)
Parameters:
Returns:

True if plugin_info was in list and successfully removed.

Return type:

bool

Remove plugin_info from list.

New in version 1.2.

classmethod new_from_file(filename)
Parameters:

filename (str) – filename to read.

Raises:

GLib.Error

Returns:

None if there is any error or a newly created NM.VpnPluginInfo instance.

Return type:

NM.VpnPluginInfo

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:
  • name (str or None) – the name to search for. Either name or service must be present.

  • service (str or None) – the service to search for. Either name or service must be present.

Returns:

a newly created instance of plugin info or None if no matching value was found.

Return type:

NM.VpnPluginInfo or None

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:

GLib.Error

Returns:

new plugin info instance.

Return type:

NM.VpnPluginInfo

This constructor does not read any data from file but takes instead a keyfile argument.

New in version 1.2.

classmethod validate_filename(filename)
Parameters:

filename (str) – the filename to check

Return type:

bool

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_aliases()
Returns:

the aliases from the name-file.

Return type:

[str]

New in version 1.4.

get_auth_dialog()
Returns:

the absolute path to the auth-dialog helper or None.

Return type:

str

New in version 1.4.

get_editor_plugin()
Returns:

the cached NM.VpnEditorPlugin instance.

Return type:

NM.VpnEditorPlugin

New in version 1.2.

get_filename()
Returns:

the filename. Can be None.

Return type:

str

New in version 1.2.

get_name()
Returns:

the name. Cannot be None.

Return type:

str

New in version 1.2.

get_plugin()
Returns:

the plugin. Can be None.

Return type:

str

New in version 1.2.

get_program()
Returns:

the program. Can be None.

Return type:

str

New in version 1.2.

get_service()
Returns:

the service. Cannot be None.

Return type:

str

New in version 1.4.

load_editor_plugin()
Raises:

GLib.Error

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 via NM.VpnPluginInfo.set_editor_plugin().

Return type:

NM.VpnEditorPlugin

New in version 1.2.

lookup_property(group, key)
Parameters:
  • group (str) – group name

  • key (str) – name of the property

Returns:

NM.VpnPluginInfo is internally a GLib.KeyFile. Returns the matching property.

Return type:

str

New in version 1.2.

set_editor_plugin(plugin)
Parameters:

plugin (NM.VpnEditorPlugin or None) – plugin instance

Set the internal plugin instance. If None, only clear the previous instance.

New in version 1.2.

supports_hints()
Returns:

True if the supports hints for secret requests, otherwise False

Return type:

bool

New in version 1.4.

supports_multiple()
Returns:

True if the service supports multiple instances with different bus names, otherwise False

Return type:

bool

New in version 1.42.

Property Details

NM.VpnPluginInfo.props.filename
Name:

filename

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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:

GLib.KeyFile

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

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.

NM.VpnPluginInfo.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE

The name of the VPN plugin.

New in version 1.2.