1 # -*- coding: utf-8 -*-
4 from ..dbusclient
import DBusClient
5 from connection
import Connection
9 class NetworkManagerSettings(DBusClient
):
10 """NetworkManagerSettings
12 The NM Settings client library
15 ListConnections ( ) → ao
18 NewConnection ( o: connection )
21 # FIXME into DBusCLient ctor
22 OPATH
= "/org/freedesktop/NetworkManagerSettings"
23 IFACE
= "org.freedesktop.NetworkManagerSettings"
26 def __init__(self
, service
):
27 # default_interface because knetworkmanager doesnt provide introspection
28 super(NetworkManagerSettings
, self
).__init
__(dbus
.SystemBus(), service
, self
.OPATH
, default_interface
= self
.IFACE
)
29 # need instance specific adaptors for user/system conn factories
30 self
._adaptors
["methods"]["ListConnections"] = seq_adaptor(self
._create
_connection
)
32 def _create_connection(self
, opath
):
33 return Connection(self
.bus_name
, opath
)
35 # FIXME better API for this
36 DBusClient
._add
_adaptors
({
38 "ListConnections": seq_adaptor(Connection
), # overriden?
41 "NewConnection": (identity
, [Connection
], {}),