Rewrote from scratch.
[cnetworkmanager.git] / networkmanager / settings / settings.py
blobc55c81d7103ce962d8f41a3f9ba7492b735dca7c
1 # -*- coding: utf-8 -*-
3 import dbus
4 from ..dbusclient import DBusClient
5 from connection import Connection
6 from ..func import *
9 class NetworkManagerSettings(DBusClient):
10 """NetworkManagerSettings
12 The NM Settings client library
14 Methods:
15 ListConnections ( ) → ao
17 Signals:
18 NewConnection ( o: connection )
19 """
21 # FIXME into DBusCLient ctor
22 OPATH = "/org/freedesktop/NetworkManagerSettings"
23 IFACE = "org.freedesktop.NetworkManagerSettings"
24 PROP_IFACE = IFACE
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({
37 "methods": {
38 "ListConnections": seq_adaptor(Connection), # overriden?
40 "signals": {
41 "NewConnection": (identity, [Connection], {}),