all: reformat python files with python black
Part of !537. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/537
This commit is contained in:

committed by
Thomas Haller

parent
b6febb0fd0
commit
be822b52e6
@@ -9,7 +9,8 @@
|
||||
# VPN plugin.
|
||||
|
||||
import gi
|
||||
gi.require_version('NM', '1.0')
|
||||
|
||||
gi.require_version("NM", "1.0")
|
||||
from gi.repository import GLib, NM
|
||||
|
||||
import sys
|
||||
@@ -35,17 +36,21 @@ for vpn_info in NM.VpnPluginInfo.list_load():
|
||||
break
|
||||
|
||||
if connection is None:
|
||||
print("None of the VPN plugins was able to import \"%s\"" % (filename))
|
||||
print('None of the VPN plugins was able to import "%s"' % (filename))
|
||||
sys.exit(1)
|
||||
|
||||
connection.normalize()
|
||||
|
||||
print("connection imported from \"%s\" using plugin \"%s\" (\"%s\", %s)" % (filename, vpn_info.get_filename(), connection.get_id(), connection.get_uuid()))
|
||||
print(
|
||||
'connection imported from "%s" using plugin "%s" ("%s", %s)'
|
||||
% (filename, vpn_info.get_filename(), connection.get_id(), connection.get_uuid())
|
||||
)
|
||||
|
||||
client = NM.Client.new(None)
|
||||
|
||||
main_loop = GLib.MainLoop()
|
||||
|
||||
|
||||
def added_cb(client, result, data):
|
||||
try:
|
||||
client.add_connection_finish(result)
|
||||
@@ -54,6 +59,7 @@ def added_cb(client, result, data):
|
||||
print("ERROR: failed to add connection: %s\n" % e)
|
||||
main_loop.quit()
|
||||
|
||||
|
||||
client.add_connection_async(connection, True, None, added_cb, None)
|
||||
|
||||
main_loop.run()
|
||||
|
Reference in New Issue
Block a user