Skip to content

Commit c1e422c

Browse files
committed
Implement proposals from @larsblumberg
This removes to too obvious comment and the use of an intermediary list.
1 parent b55681e commit c1e422c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gatt/gatt_linux.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,14 +557,12 @@ def __init__(self, service, path, uuid):
557557
self._properties = dbus.Interface(self._object, "org.freedesktop.DBus.Properties")
558558
self._properties_signal = None
559559

560-
# extract the descriptions from the paths obtained via dbus. They end with /descXXXX.
561-
self.descriptors = []
562560
descriptor_regex = re.compile(self._path + '/desc[0-9abcdef]{4}$')
563-
managed_descriptors = [desc for desc in self._object_manager.GetManagedObjects().items() if
564-
descriptor_regex.match(desc[0])]
565-
566-
for desc in managed_descriptors:
567-
self.descriptors.append(Descriptor(self, desc[0], desc[1]['org.bluez.GattDescriptor1']['UUID']))
561+
self.descriptors = [
562+
Descriptor(self, desc[0], desc[1]['org.bluez.GattDescriptor1']['UUID'])
563+
for desc in self._object_manager.GetManagedObjects().items()
564+
if descriptor_regex.match(desc[0])
565+
]
568566

569567
def _connect_signals(self):
570568
if self._properties_signal is None:

0 commit comments

Comments
 (0)