Skip to content

Commit 0bc32de

Browse files
committed
Merge tag '0.9.13' into debian
2 parents 6fca586 + ae2941c commit 0bc32de

6 files changed

Lines changed: 35 additions & 6 deletions

File tree

COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python-networkmanager - Easy communication with NetworkManager
2-
Copyright (C) 2011 Dennis Kaarsemaker <dennis@kaarsemaker.net>
2+
Copyright (C) 2011-2015 Dennis Kaarsemaker <dennis@kaarsemaker.net>
33

44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by

NetworkManager.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NetworkManager - a library to make interacting with the NetworkManager daemon
22
# easier.
33
#
4-
# (C)2011-2013 Dennis Kaarsemaker
4+
# (C)2011-2015 Dennis Kaarsemaker
55
# License: GPL3+
66

77
import dbus
@@ -141,6 +141,8 @@ def preprocess(self, name, args, kwargs):
141141
for key in settings:
142142
if 'mac-address' in settings[key]:
143143
settings[key]['mac-address'] = fixups.mac_to_dbus(settings[key]['mac-address'])
144+
if 'cloned-mac-address' in settings[key]:
145+
settings[key]['cloned-mac-address'] = fixups.mac_to_dbus(settings[key]['cloned-mac-address'])
144146
if 'bssid' in settings[key]:
145147
settings[key]['bssid'] = fixups.mac_to_dbus(settings[key]['mac-address'])
146148
if 'ssid' in settings.get('802-11-wireless', {}):
@@ -184,6 +186,8 @@ def postprocess(self, name, val):
184186
val_ = val[key]
185187
if 'mac-address' in val_:
186188
val_['mac-address'] = fixups.mac_to_python(val_['mac-address'])
189+
if 'cloned-mac-address' in val_:
190+
val_['cloned-mac-address'] = fixups.mac_to_python(val_['cloned-mac-address'])
187191
if 'bssid' in val_:
188192
val_['bssid'] = fixups.mac_to_python(val_['bssid'])
189193
if 'ipv4' in val:
@@ -225,6 +229,8 @@ class AccessPoint(NMDbusInterface):
225229
def postprocess(self, name, val):
226230
if name == 'Ssid':
227231
return fixups.ssid_to_python(val)
232+
elif name == 'Strength':
233+
return fixups.strength_to_python(val)
228234
return val
229235

230236
class Wired(NMDbusInterface):
@@ -326,6 +332,10 @@ def ssid_to_dbus(ssid):
326332
ssid = ssid.encode('utf-8')
327333
return [dbus.Byte(x) for x in ssid]
328334

335+
@staticmethod
336+
def strength_to_python(strength):
337+
return struct.unpack('B', strength)[0]
338+
329339
@staticmethod
330340
def mac_to_python(mac):
331341
return "%02X:%02X:%02X:%02X:%02X:%02X" % tuple([ord(x) for x in mac])
@@ -412,9 +422,12 @@ def route_to_dbus(route):
412422
NM_DEVICE_TYPE_VLAN = 11
413423
NM_DEVICE_TYPE_ADSL = 12
414424
NM_DEVICE_TYPE_BRIDGE = 13
425+
NM_DEVICE_TYPE_GENERIC = 14
426+
NM_DEVICE_TYPE_TEAM = 15
415427
NM_DEVICE_CAP_NONE = 0
416428
NM_DEVICE_CAP_NM_SUPPORTED = 1
417429
NM_DEVICE_CAP_CARRIER_DETECT = 2
430+
NM_DEVICE_CAP_IS_SOFTWARE = 4
418431
NM_WIFI_DEVICE_CAP_NONE = 0
419432
NM_WIFI_DEVICE_CAP_CIPHER_WEP40 = 1
420433
NM_WIFI_DEVICE_CAP_CIPHER_WEP104 = 2
@@ -519,6 +532,11 @@ def route_to_dbus(route):
519532
NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE = 52
520533
NM_DEVICE_STATE_REASON_SSID_NOT_FOUND = 53
521534
NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED = 54
535+
NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED = 55
536+
NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED = 56
537+
NM_DEVICE_STATE_REASON_MODEM_FAILED = 57
538+
NM_DEVICE_STATE_REASON_MODEM_AVAILABLE = 58
539+
NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT = 59
522540
NM_DEVICE_STATE_REASON_LAST = 65535
523541
NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0
524542
NM_ACTIVE_CONNECTION_STATE_ACTIVATING = 1

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
# General information about the project.
4343
project = u'python-networkmanager'
44-
copyright = u'2011-2013, Dennis Kaarsemaker'
44+
copyright = u'2011-2015, Dennis Kaarsemaker'
4545

4646
# The version info for the project you're documenting, acts as replacement for
4747
# |version| and |release|, also used in various other places throughout the
@@ -50,7 +50,7 @@
5050
# The short X.Y version.
5151
version = '0.9'
5252
# The full version, including alpha/beta/rc tags.
53-
release = '0.9.12'
53+
release = '0.9.13'
5454

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

examples/ssids.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""
2+
Display all visible SSIDs
3+
"""
4+
5+
import NetworkManager
6+
7+
for dev in NetworkManager.NetworkManager.GetDevices():
8+
if dev.DeviceType != NetworkManager.NM_DEVICE_TYPE_WIFI:
9+
continue
10+
for ap in dev.SpecificDevice().GetAccessPoints():
11+
print '%-30s %dMHz %d%%' % (ap.Ssid, ap.Frequency, ap.Strength)

n-m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Command-line tool to interact with NetworkManager. With this tool, you can
44
# inspect various configuration items and (de-)activate connections.
55
#
6-
# (C) 2011-2013 Dennis Kaarsemaker
6+
# (C) 2011-2015 Dennis Kaarsemaker
77
# License: GPL3+
88

99
from __future__ import print_function

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 = "0.9.12",
6+
version = "0.9.13",
77
author = "Dennis Kaarsemaker",
88
author_email = "dennis@kaarsemaker.net",
99
url = "http://github.com/seveas/python-networkmanager",

0 commit comments

Comments
 (0)