@@ -27,20 +27,7 @@ simple as you think it is:
2727 NetworkManager exposes a lot of information via D-Bus and also allows full
2828control of network settings. The full D-Bus interface can be found on
2929`NetworkManager project website `_. All interfaces listed there have been
30- wrapped in classes as listed below. With a few exceptions, they behave exactly
31- like the D-Bus methods. These exceptions are for convenience and limited to
32- this list:
33-
34- * IP addresses are returned as strings of the form :data: `1.2.3.4 ` instead of
35- network byte ordered integers.
36- * Route metrics are returned in host byte order, so you can use them as
37- integers.
38- * Mac addresses and BSSIDs are always returned as strings of the form
39- :data: `00:11:22:33:44:55 ` instead of byte sequences.
40- * Wireless SSID's are returned as strings instead of byte sequences. They will
41- be decoded as UTF-8 data, so using any other encoding for your SSID will
42- result in errors.
43- * DHCP options are turned into integers or booleans as appropriate
30+ wrapped in classes as listed below.
4431
4532.. function :: const(prefix, value)
4633
@@ -61,6 +48,52 @@ translate them to text. For example:
6148
6249List of classes
6350---------------
51+ .. class :: ObjectVanished
52+
53+ This Exception will be raised when you try to call a method or access a
54+ property on a dbus object that no longer exists. Objects can go missing if
55+ devices are removed, connections are disabled or NetworkManager is restarted.
56+
57+ .. class :: NMDbusInterface
58+
59+ This is the base class of all classes below. It handles the marshalling of data
60+ and the automatic creation of properties and methods.
61+
62+ Each property, method and signal exposed via the D-Bus interface is
63+ automatically mirrored as an attribute of the actual classes. Moreover, the
64+ data is made slightly more usable by performing the following transformations
65+ on received and sent data.
66+
67+ * IP addresses are returned as strings of the form :data: `1.2.3.4 ` instead of
68+ network byte ordered integers.
69+ * Route metrics are returned in host byte order, so you can use them as
70+ integers.
71+ * Mac addresses and BSSIDs are always returned as strings of the form
72+ :data: `00:11:22:33:44:55 ` instead of byte sequences.
73+ * Wireless SSID's are returned as strings instead of byte sequences. They will
74+ be decoded as UTF-8 data, so using any other encoding for your SSID will
75+ result in errors.
76+ * DHCP options are turned into integers or booleans as appropriate
77+ * Signals can be connected to using calls to On\ *SignalName * functions.
78+
79+ Here's a short example to illustrate:
80+
81+ >>> NetworkManager.NetworkManager.Version
82+ '1.4.4'
83+ >>> NetworkManager.NetworkManager.GetPermissions()
84+ {'org.freedesktop.NetworkManager.checkpoint-rollback': 'auth',
85+ 'org.freedesktop.NetworkManager.enable-disable-network': 'yes',
86+ ...}
87+ # Must have a mainloop to use signals
88+ >>> import dbus.mainloop.glib
89+ >>> dbus.mainloop.glib.DBusGMainLoop(set_as_default = True )
90+ >>> NetworkManager.Networkmanager.OnStateChanged(handle_state_change)
91+
92+ .. class :: TransientNMDbusInterface
93+
94+ Subclasses of this class, which are ActiveConnection, NSP, IP[46]Config and
95+ DHCP[46]Config never survive a NetworkManager restart. Other objects may
96+ survive a restart, but get a different object path.
6497
6598.. class :: NetworkManager
6699
0 commit comments