all: reformat python files with python black

Part of !537.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/537
This commit is contained in:
Sayed Shah
2020-06-09 16:28:32 -04:00
committed by Thomas Haller
parent b6febb0fd0
commit be822b52e6
44 changed files with 3179 additions and 1961 deletions

View File

@@ -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()