Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d3b3b5

Browse files
committed
Update constants, classes and version numbers to match 1.2.0
Also alphabetize the list of device types.
1 parent 6da0797 commit 5d3b3b5

File tree

4 files changed

+86
-44
lines changed

4 files changed

+86
-44
lines changed

NetworkManager.py

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,24 @@ class Device(NMDbusInterface):
264264

265265
def SpecificDevice(self):
266266
return {
267+
NM_DEVICE_TYPE_ADSL: Adsl,
268+
NM_DEVICE_TYPE_BOND: Bond,
269+
NM_DEVICE_TYPE_BRIDGE: Bridge,
270+
NM_DEVICE_TYPE_BT: Bluetooth,
267271
NM_DEVICE_TYPE_ETHERNET: Wired,
268-
NM_DEVICE_TYPE_WIFI: Wireless,
272+
NM_DEVICE_TYPE_GENERIC: Generic,
273+
NM_DEVICE_TYPE_INFINIBAND: Infiniband,
274+
NM_DEVICE_TYPE_IP_TUNNEL: IPTunnel,
275+
NM_DEVICE_TYPE_MACVLAN: Macvlan,
269276
NM_DEVICE_TYPE_MODEM: Modem,
270-
NM_DEVICE_TYPE_BT: Bluetooth,
271277
NM_DEVICE_TYPE_OLPC_MESH: OlpcMesh,
272-
NM_DEVICE_TYPE_WIMAX: Wimax,
273-
NM_DEVICE_TYPE_INFINIBAND: Infiniband,
274-
NM_DEVICE_TYPE_BOND: Bond,
278+
NM_DEVICE_TYPE_TEAM: Team,
279+
NM_DEVICE_TYPE_TUN: Tun,
280+
NM_DEVICE_TYPE_VETH: Veth,
275281
NM_DEVICE_TYPE_VLAN: Vlan,
276-
NM_DEVICE_TYPE_ADSL: Adsl,
277-
NM_DEVICE_TYPE_BRIDGE: Bridge,
278-
NM_DEVICE_TYPE_GENERIC: Generic
282+
NM_DEVICE_TYPE_VXLAN: Vxlan,
283+
NM_DEVICE_TYPE_WIFI: Wireless,
284+
NM_DEVICE_TYPE_WIMAX: Wimax,
279285
}[self.DeviceType](self.object_path)
280286

281287
def postprocess(self, name, val):
@@ -295,42 +301,60 @@ def postprocess(self, name, val):
295301
return fixups.strength_to_python(val)
296302
return val
297303

298-
class Wired(NMDbusInterface):
299-
interface_name = 'org.freedesktop.NetworkManager.Device.Wired'
300-
301-
class Wireless(NMDbusInterface):
302-
interface_name = 'org.freedesktop.NetworkManager.Device.Wireless'
303-
304-
class Modem(NMDbusInterface):
305-
interface_name = 'org.freedesktop.NetworkManager.Device.Modem'
304+
class Adsl(NMDbusInterface):
305+
interface_name = 'org.freedesktop.NetworkManager.Device.adsl'
306306

307307
class Bluetooth(NMDbusInterface):
308308
interface_name = 'org.freedesktop.NetworkManager.Device.Bluetooth'
309309

310-
class OlpcMesh(NMDbusInterface):
311-
interface_name = 'org.freedesktop.NetworkManager.Device.OlpcMesh'
310+
class Bond(NMDbusInterface):
311+
interface_name = 'org.freedesktop.NetworkManager.Device.Bond'
312312

313-
class Wimax(NMDbusInterface):
314-
interface_name = 'org.freedesktop.NetworkManager.Device.Wimax'
313+
class Bridge(NMDbusInterface):
314+
interface_name = 'org.freedesktop.NetworkManager.Device.Bridge'
315+
316+
class Generic(NMDbusInterface):
317+
interface_name = 'org.freedesktop.NetworkManager.Device.Generic'
315318

316319
class Infiniband(NMDbusInterface):
317320
interface_name = 'org.freedesktop.NetworkManager.Device.Infiniband'
318321

319-
class Bond(NMDbusInterface):
320-
interface_name = 'org.freedesktop.NetworkManager.Device.Bond'
322+
class IPTunnel(NMDbusInterface):
323+
interface_name = 'org.freedesktop.NetworkManager.Device.Infiniband'
321324

322-
class Bridge(NMDbusInterface):
323-
interface_name = 'org.freedesktop.NetworkManager.Device.Bridge'
325+
class Macvlan(NMDbusInterface):
326+
interface_name = 'org.freedesktop.NetworkManager.Device.Generic'
327+
328+
class Modem(NMDbusInterface):
329+
interface_name = 'org.freedesktop.NetworkManager.Device.Modem'
330+
331+
class OlpcMesh(NMDbusInterface):
332+
interface_name = 'org.freedesktop.NetworkManager.Device.OlpcMesh'
333+
334+
class Team(NMDbusInterface):
335+
interface_name = 'org.freedesktop.NetworkManager.Device.Generic'
336+
337+
class Tun(NMDbusInterface):
338+
interface_name = 'org.freedesktop.NetworkManager.Device.Generic'
339+
340+
class Veth(NMDbusInterface):
341+
interface_name = 'org.freedesktop.NetworkManager.Device.Generic'
324342

325343
class Vlan(NMDbusInterface):
326344
interface_name = 'org.freedesktop.NetworkManager.Device.Vlan'
327345

328-
class Adsl(NMDbusInterface):
329-
interface_name = 'org.freedesktop.NetworkManager.Device.adsl'
330-
331-
class Generic(NMDbusInterface):
346+
class Vxlan(NMDbusInterface):
332347
interface_name = 'org.freedesktop.NetworkManager.Device.Generic'
333348

349+
class Wimax(NMDbusInterface):
350+
interface_name = 'org.freedesktop.NetworkManager.Device.Wimax'
351+
352+
class Wired(NMDbusInterface):
353+
interface_name = 'org.freedesktop.NetworkManager.Device.Wired'
354+
355+
class Wireless(NMDbusInterface):
356+
interface_name = 'org.freedesktop.NetworkManager.Device.Wireless'
357+
334358
class NSP(NMDbusInterface):
335359
interface_name = 'org.freedesktop.NetworkManager.Wimax.NSP'
336360

@@ -513,6 +537,11 @@ def route_to_dbus(route,family):
513537
NM_DEVICE_TYPE_BRIDGE = 13
514538
NM_DEVICE_TYPE_GENERIC = 14
515539
NM_DEVICE_TYPE_TEAM = 15
540+
NM_DEVICE_TYPE_TUN = 16
541+
NM_DEVICE_TYPE_IP_TUNNEL = 17
542+
NM_DEVICE_TYPE_MACVLAN = 18
543+
NM_DEVICE_TYPE_VXLAN = 19
544+
NM_DEVICE_TYPE_VETH = 20
516545
NM_DEVICE_CAP_NONE = 0
517546
NM_DEVICE_CAP_NM_SUPPORTED = 1
518547
NM_DEVICE_CAP_CARRIER_DETECT = 2
@@ -529,6 +558,7 @@ def route_to_dbus(route,family):
529558
NM_WIFI_DEVICE_CAP_FREQ_VALID = 256
530559
NM_WIFI_DEVICE_CAP_FREQ_2GHZ = 512
531560
NM_WIFI_DEVICE_CAP_FREQ_5GHZ = 1024
561+
NM_WIFI_DEVICE_CAP_IBSS_RSN = 2048
532562
NM_802_11_AP_FLAGS_NONE = 0
533563
NM_802_11_AP_FLAGS_PRIVACY = 1
534564
NM_802_11_AP_SEC_NONE = 0

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = '1.1'
51+
version = '1.2'
5252
# The full version, including alpha/beta/rc tags.
53-
release = '1.1'
53+
release = '1.2'
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.

docs/index.rst

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ simple as you think it is:
2424
2525
>>> import NetworkManager
2626
>>> NetworkManager.NetworkManager.Version
27-
'1.0.4'
27+
'1.2.0'
2828
2929
NetworkManager exposes a lot of information via D-Bus and also allows full
3030
control of network settings. The full D-Bus API can be found on `NetworkManager
@@ -71,7 +71,7 @@ translate them to text. For example:
7171
>>> NetworkManager.const('device_type', 2)
7272
'wifi'
7373
74-
.. _`NetworkManager project website`: https://developer.gnome.org/NetworkManager/0.9/spec.html
74+
.. _`NetworkManager project website`: https://developer.gnome.org/NetworkManager/1.2/spec.html
7575

7676
List of classes
7777
---------------
@@ -110,29 +110,41 @@ interface.
110110

111111
.. class:: Device
112112

113-
.. class:: Wired
114-
115-
.. class:: Wireless
116-
117-
.. class:: Modem
113+
.. class:: Adsl
118114

119115
.. class:: Bluetooth
120116

121-
.. class:: OlpcMesh
117+
.. class:: Bond
122118

123-
.. class:: Wimax
119+
.. class:: Bridge
120+
121+
.. class:: Generic
124122

125123
.. class:: Infiniband
126124

127-
.. class:: Bond
125+
.. class:: IPTunnel
128126

129-
.. class:: Bridge
127+
.. class:: Macvlan
128+
129+
.. class:: Modem
130+
131+
.. class:: OlpcMesh
132+
133+
.. class:: Team
134+
135+
.. class:: Tun
136+
137+
.. class:: Veth
130138

131139
.. class:: Vlan
132140

133-
.. class:: Adsl
141+
.. class:: Vxlan
134142

135-
.. class:: Generic
143+
.. class:: Wimax
144+
145+
.. class:: Wired
146+
147+
.. class:: Wireless
136148

137149
These classes represent D-Bus interfaces for various types of hardware. Note
138150
that methods such as :data:`NetworkManager.GetDevices()` will only return

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from distutils.core import setup
44

55
setup(name = "python-networkmanager",
6-
version = "1.1",
6+
version = "1.2",
77
author = "Dennis Kaarsemaker",
88
author_email = "[email protected]",
99
url = "http://github.com/seveas/python-networkmanager",

0 commit comments

Comments
 (0)