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:
Yifan J
2017-12-02 12:44:50 +08:00
committed by Thomas Haller
parent 5e239d2c04
commit 797d9c4403
25 changed files with 104 additions and 104 deletions

View File

@@ -69,20 +69,20 @@ for d in devices:
dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d)
prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties")
props = prop_iface.GetAll("org.freedesktop.NetworkManager.Device")
print "============================"
print("============================")
print "Interface: %s" % props['Interface']
print("Interface: %s" % props['Interface'])
try:
devtype = devtypes[props['DeviceType']]
except KeyError:
devtype = "Unknown"
print "Type: %s" % devtype
print("Type: %s" % devtype)
print "Driver: %s" % props['Driver']
print("Driver: %s" % props['Driver'])
try:
state = states[props['State']]
except KeyError:
state = "Unknown"
print "State: %s" % state
print("State: %s" % state)