Skip to content

Commit a598b5b

Browse files
committed
Merge elements of connect function
1 parent e03e9ef commit a598b5b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/common/wifi.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,17 @@ def connect(conn_type=config.type_hotspot,
6161
logger.info(f"Added connection of type {conn_type}")
6262

6363
# Find this connection and its device
64-
connections = NetworkManager.Settings.ListConnections()
65-
connections = dict([(x.GetSettings()['connection']['id'], x)
66-
for x in connections])
64+
connections = \
65+
dict([(x.GetSettings()['connection']['id'], x)
66+
for x in NetworkManager.Settings.ListConnections()])
6767
conn = connections[config.ap_name]
6868

6969
# Find a suitable device
7070
ctype = conn.GetSettings()['connection']['type']
7171
dtype = {'802-11-wireless': NetworkManager.NM_DEVICE_TYPE_WIFI} \
7272
.get(ctype, ctype)
73-
devices = NetworkManager.NetworkManager.GetDevices()
7473

75-
for dev in devices:
74+
for dev in NetworkManager.NetworkManager.GetDevices():
7675
if dev.DeviceType == dtype:
7776
break
7877
else:

0 commit comments

Comments
 (0)