about summary refs log tree commit diff
path: root/examples/python/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'examples/python/dbus')
-rwxr-xr-xexamples/python/dbus/add-connection-compat.py2
-rwxr-xr-xexamples/python/dbus/add-connection.py2
-rwxr-xr-xexamples/python/dbus/add-wifi-eap-connection.py2
-rwxr-xr-xexamples/python/dbus/add-wifi-psk-connection.py6
-rwxr-xr-xexamples/python/dbus/create-bond.py2
-rwxr-xr-xexamples/python/dbus/disconnect-device.py2
-rwxr-xr-xexamples/python/dbus/get-active-connection-uuids.py2
-rwxr-xr-xexamples/python/dbus/is-wwan-default.py2
-rwxr-xr-xexamples/python/dbus/list-connections.py2
-rwxr-xr-xexamples/python/dbus/list-devices.py2
-rwxr-xr-xexamples/python/dbus/nm-state.py2
-rwxr-xr-xexamples/python/dbus/show-bssids.py9
-rwxr-xr-xexamples/python/dbus/update-ip4-method.py2
-rwxr-xr-xexamples/python/dbus/update-secrets.py2
-rwxr-xr-xexamples/python/dbus/vpn.py2
-rwxr-xr-xexamples/python/dbus/wifi-active-ap.py2
-rwxr-xr-xexamples/python/dbus/wifi-hotspot.py2
17 files changed, 25 insertions, 20 deletions
diff --git a/examples/python/dbus/add-connection-compat.py b/examples/python/dbus/add-connection-compat.py
index 2661eccb..d5218514 100755
--- a/examples/python/dbus/add-connection-compat.py
+++ b/examples/python/dbus/add-connection-compat.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 - 2012 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/add-connection.py b/examples/python/dbus/add-connection.py
index a7c8947c..cfb46de2 100755
--- a/examples/python/dbus/add-connection.py
+++ b/examples/python/dbus/add-connection.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 - 2012 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/add-wifi-eap-connection.py b/examples/python/dbus/add-wifi-eap-connection.py
index 23962e76..8ed80f72 100755
--- a/examples/python/dbus/add-wifi-eap-connection.py
+++ b/examples/python/dbus/add-wifi-eap-connection.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2011 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/add-wifi-psk-connection.py b/examples/python/dbus/add-wifi-psk-connection.py
index 66d42e82..c9a4ceed 100755
--- a/examples/python/dbus/add-wifi-psk-connection.py
+++ b/examples/python/dbus/add-wifi-psk-connection.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2015 Red Hat, Inc.
 #
@@ -11,11 +11,11 @@ s_con = dbus.Dictionary(
 )
 
 s_wifi = dbus.Dictionary(
-    {"ssid": dbus.ByteArray("best-wifi".encode("utf-8")), "mode": "infrastructure",}
+    {"ssid": dbus.ByteArray("best-wifi".encode("utf-8")), "mode": "infrastructure"}
 )
 
 s_wsec = dbus.Dictionary(
-    {"key-mgmt": "wpa-psk", "auth-alg": "open", "psk": "super-secret-password",}
+    {"key-mgmt": "wpa-psk", "auth-alg": "open", "psk": "super-secret-password"}
 )
 
 s_ip4 = dbus.Dictionary({"method": "auto"})
diff --git a/examples/python/dbus/create-bond.py b/examples/python/dbus/create-bond.py
index 77c2ece4..4ebec24a 100755
--- a/examples/python/dbus/create-bond.py
+++ b/examples/python/dbus/create-bond.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2015 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/disconnect-device.py b/examples/python/dbus/disconnect-device.py
index 1b257025..d44eb1bd 100755
--- a/examples/python/dbus/disconnect-device.py
+++ b/examples/python/dbus/disconnect-device.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/get-active-connection-uuids.py b/examples/python/dbus/get-active-connection-uuids.py
index 3e80b603..1ba156b6 100755
--- a/examples/python/dbus/get-active-connection-uuids.py
+++ b/examples/python/dbus/get-active-connection-uuids.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/is-wwan-default.py b/examples/python/dbus/is-wwan-default.py
index 18279db0..749b71b3 100755
--- a/examples/python/dbus/is-wwan-default.py
+++ b/examples/python/dbus/is-wwan-default.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2011 - 2012 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/list-connections.py b/examples/python/dbus/list-connections.py
index 81b32896..c5381b69 100755
--- a/examples/python/dbus/list-connections.py
+++ b/examples/python/dbus/list-connections.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 - 2011 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/list-devices.py b/examples/python/dbus/list-devices.py
index 910bc461..17654f38 100755
--- a/examples/python/dbus/list-devices.py
+++ b/examples/python/dbus/list-devices.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2011 - 2012 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/nm-state.py b/examples/python/dbus/nm-state.py
index 4bc9285e..27e99e27 100755
--- a/examples/python/dbus/nm-state.py
+++ b/examples/python/dbus/nm-state.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 - 2012 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/show-bssids.py b/examples/python/dbus/show-bssids.py
index b56822fb..17364e49 100755
--- a/examples/python/dbus/show-bssids.py
+++ b/examples/python/dbus/show-bssids.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 Red Hat, Inc.
 #
@@ -7,6 +7,11 @@
 # This example prints out all the AP BSSIDs that all Wi-Fi devices on the
 # machine can see.  Useful for location-based services like Skyhook that
 # can geolocate you based on the APs you can see.
+#
+# Note that with NetworkManager clients are required to request scanning.
+# If you don't do that, the scan list may be outdated. That means, you would
+# check the LastScan property, and if necessary call RequestScan() first.
+# After RequestScan(), you wait until the LastScan property gets bumped again.
 
 import dbus
 
@@ -30,7 +35,7 @@ for d in devices:
 
     # Make sure the device is enabled before we try to use it
     state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State")
-    if state <= 2:
+    if state <= 20:  # NM_DEVICE_STATE_UNAVAILABLE
         continue
 
     # Get device's type; we only want wifi devices
diff --git a/examples/python/dbus/update-ip4-method.py b/examples/python/dbus/update-ip4-method.py
index 98927903..d84e01b2 100755
--- a/examples/python/dbus/update-ip4-method.py
+++ b/examples/python/dbus/update-ip4-method.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2014 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/update-secrets.py b/examples/python/dbus/update-secrets.py
index 5df25e5c..ce69cb9a 100755
--- a/examples/python/dbus/update-secrets.py
+++ b/examples/python/dbus/update-secrets.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2011 - 2012 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/vpn.py b/examples/python/dbus/vpn.py
index 814e4415..f86bf1ad 100755
--- a/examples/python/dbus/vpn.py
+++ b/examples/python/dbus/vpn.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2009 Novell, Inc.
 # Copyright (C) 2009 Red Hat, Inc.
diff --git a/examples/python/dbus/wifi-active-ap.py b/examples/python/dbus/wifi-active-ap.py
index 33fae0b2..bc8f1ea5 100755
--- a/examples/python/dbus/wifi-active-ap.py
+++ b/examples/python/dbus/wifi-active-ap.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2015 Red Hat, Inc.
 #
diff --git a/examples/python/dbus/wifi-hotspot.py b/examples/python/dbus/wifi-hotspot.py
index 77582b6a..a441e7e9 100755
--- a/examples/python/dbus/wifi-hotspot.py
+++ b/examples/python/dbus/wifi-hotspot.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (C) 2010 - 2012 Red Hat, Inc.
 #