examples/python: avoid Python2 "print" statement
Recent python-black (22.0) dropped support for Python 2 and thus fail for those files. Make the examples Python3 compatible.
This commit is contained in:
@@ -15,22 +15,28 @@ if __name__ == "__main__":
|
||||
client = NM.Client.new(None)
|
||||
devices = client.get_all_devices()
|
||||
|
||||
print "Real devices"
|
||||
print "------------"
|
||||
print("Real devices")
|
||||
print("------------")
|
||||
for d in devices:
|
||||
if d.is_real():
|
||||
print "%s (%s): %s" % (
|
||||
d.get_iface(),
|
||||
d.get_type_description(),
|
||||
d.get_state(),
|
||||
print(
|
||||
"%s (%s): %s"
|
||||
% (
|
||||
d.get_iface(),
|
||||
d.get_type_description(),
|
||||
d.get_state(),
|
||||
)
|
||||
)
|
||||
|
||||
print "\nUnrealized/placeholder devices"
|
||||
print "------------------------------"
|
||||
print("\nUnrealized/placeholder devices")
|
||||
print("------------------------------")
|
||||
for d in devices:
|
||||
if not d.is_real():
|
||||
print "%s (%s): %s" % (
|
||||
d.get_iface(),
|
||||
d.get_type_description(),
|
||||
d.get_state(),
|
||||
print(
|
||||
"%s (%s): %s"
|
||||
% (
|
||||
d.get_iface(),
|
||||
d.get_type_description(),
|
||||
d.get_state(),
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user