1 # -*- coding: utf-8 -*-
4 from dbusclient
import DBusClient
, object_path
5 from device
import Device
9 # need better/shorter names? or hide them?
10 SYSTEM_SERVICE
= "org.freedesktop.NetworkManagerSystemSettings"
11 USER_SERVICE
= "org.freedesktop.NetworkManagerUserSettings"
13 class NetworkManager(DBusClient
):
20 ActivateConnection ( s: service_name, o: connection, o: device, o: specific_object ) → o
21 DeactivateConnection ( o: active_connection ) → nothing
22 Sleep ( b: sleep ) → nothing
25 StateChanged ( u: state )
26 PropertiesChanged ( a{sv}: properties )
27 DeviceAdded ( o: device_path )
28 DeviceRemoved ( o: device_path )
31 WirelessEnabled - b - (readwrite)
32 WirelessHardwareEnabled - b - (read)
33 ActiveConnections - ao - (read)
34 State - u - (read) (NM_STATE)
40 SERVICE
= "org.freedesktop.NetworkManager"
41 OPATH
= "/org/freedesktop/NetworkManager"
42 IFACE
= "org.freedesktop.NetworkManager"
45 super(NetworkManager
, self
).__init
__(dbus
.SystemBus(), self
.SERVICE
, self
.OPATH
, default_interface
=self
.IFACE
)
55 "TODO find a good term for 'adaptor'"
58 "GetDevices": seq_adaptor(Device
._create
),
59 "ActivateConnection": (identity
, [identity
, object_path
, object_path
, object_path
], {}),
60 "DeactivateConnection": (identity
, [object_path
], {})
64 "WirelessEnabled": bool,
65 "WirelessHardwareEnabled": bool,
66 "ActiveConnections": seq_adaptor(identity
), # TODO
69 "StateChanged": (identity
, [State
], {}),