about summary refs log tree commit diff
path: root/examples/python/dbus/vpn.py
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-06-04 00:07:45 +0200
committerMichael Biebl <biebl@debian.org>2018-06-04 00:07:45 +0200
commit04bc9e1cd3544445d883ad29ea108c1645c8e7b7 (patch)
treed10c354b1b980ca8a7b9e48ec9019e8ed88bde2b /examples/python/dbus/vpn.py
parentee9c73a923909e23a649407be77e25235d769e25 (diff)
New upstream version 1.11.4 upstream/1.11.4
Diffstat (limited to 'examples/python/dbus/vpn.py')
-rwxr-xr-xexamples/python/dbus/vpn.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/python/dbus/vpn.py b/examples/python/dbus/vpn.py
index d60e470e..a21b82ff 100755
--- a/examples/python/dbus/vpn.py
+++ b/examples/python/dbus/vpn.py
@@ -61,7 +61,7 @@ def list_uuids():
         iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager.Settings.Connection')
         settings = iface.GetSettings()
         conn = settings['connection']
-        print "%s - %s (%s)" % (conn['uuid'], conn['id'], conn['type'])
+        print("%s - %s (%s)" % (conn['uuid'], conn['id'], conn['type']))
 
 
 def get_active_connection_path(uuid):
@@ -102,7 +102,7 @@ def get_wifi_device_path():
 def activate_connection(connection_path, device_path):
 
     def reply_handler(opath):
-        print "Success: device activating"
+        print("Success: device activating")
         sys.exit(0)
 
     def error_handler(*args):
@@ -114,7 +114,7 @@ def activate_connection(connection_path, device_path):
     iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager')
     iface.ActivateConnection('org.freedesktop.NetworkManager',
                              connection_path,
-                             device_path, 
+                             device_path,
                              "/",
                              reply_handler=reply_handler,
                              error_handler=error_handler)
@@ -126,26 +126,26 @@ if UID != 0:
 
 # Are we configured?
 if not len(CONNECTION_UUID):
-    print "missing connection UUID"
+    print("missing connection UUID")
     sys.exit(0)
 
 connection_path = get_connection_by_uuid(CONNECTION_UUID)
 if not connection_path:
     # Configured VPN connection is not known to NM, check CONNECTION_UUID.
-    print "couldn't find the connection"
+    print("couldn't find the connection")
     sys.exit(1)
 
 device_path = get_wifi_device_path()
 if not device_path:
-    print "no wifi device found"
+    print("no wifi device found")
     sys.exit(1)
 
 # Is it already activated?
 if get_active_connection_path(CONNECTION_UUID):
-    print "already connected"
+    print("already connected")
     sys.exit(0)
 
-print "Activating connection..."
+print("Activating connection...")
 activate_connection(connection_path, device_path)
 loop = gobject.MainLoop()
 loop.run()