python: make dbus, gi examples, and debug-helper.py python3 ready
https://bugzilla.gnome.org/show_bug.cgi?id=791121
This commit is contained in:
@@ -32,7 +32,7 @@ proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager/Settings")
|
||||
settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings")
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print "Usage: %s <ifname>" % sys.argv[0]
|
||||
print("Usage: %s <ifname>" % sys.argv[0])
|
||||
sys.exit(0)
|
||||
|
||||
# Get the device object path based on interface name
|
||||
@@ -46,7 +46,7 @@ proxy = bus.get_object(service_name, devpath)
|
||||
props = dbus.Interface(proxy, "org.freedesktop.DBus.Properties")
|
||||
active_ap_path = props.Get("org.freedesktop.NetworkManager.Device.Wireless", "ActiveAccessPoint")
|
||||
if active_ap_path == "/":
|
||||
print "%s is not currently associated" % sys.argv[1]
|
||||
print("%s is not currently associated" % sys.argv[1])
|
||||
sys.exit(0)
|
||||
|
||||
# Get the active access point's SSID and BSSID
|
||||
@@ -60,7 +60,7 @@ ssid = ""
|
||||
for c in raw_ssid:
|
||||
ssid = ssid + chr(c)
|
||||
|
||||
print "%s is associated to '%s' (%s)" % (sys.argv[1], ssid, bssid)
|
||||
print("%s is associated to '%s' (%s)" % (sys.argv[1], ssid, bssid))
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
|
Reference in New Issue
Block a user