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"
25 def __init__(self
, service
):
26 # default_interface because knetworkmanager doesnt provide introspection
27 super(NetworkManagerSettings
, self
).__init
__(dbus
.SystemBus(), service
, self
.OPATH
, default_interface
= self
.IFACE
)
28 # need instance specific adaptors for user/system conn factories
29 self
._adaptors
["methods"]["ListConnections"] = seq_adaptor(self
._create
_connection
)
31 def _create_connection(self
, opath
):
32 return Connection(self
.bus_name
, opath
)
34 # FIXME better API for this
35 DBusClient
._add
_adaptors
({
37 "ListConnections": seq_adaptor(Connection
), # overriden?
40 "NewConnection": (identity
, [Connection
], {}),