Skip to content

Commit

Permalink
Fix violations in newer flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
peplin committed Aug 3, 2024
1 parent cefa482 commit 4e3e97f
Show file tree
Hide file tree
Showing 22 changed files with 1,791 additions and 1,603 deletions.
1 change: 1 addition & 0 deletions pygatt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class NullHandler(logging.Handler):
def emit(self, record):
pass


# Initialize a null handler for logging to avoid printing spurious "No handlers
# could be found for logger" messages.
logging.getLogger(__name__).addHandler(NullHandler())
Expand Down
16 changes: 9 additions & 7 deletions pygatt/backends/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

DEFAULT_CONNECT_TIMEOUT_S = 5.0

BLEAddressType = Enum('BLEAddressType', 'public random')
BLEAddressType = Enum("BLEAddressType", "public random")


class BLEBackend(object):
Expand All @@ -21,8 +21,7 @@ def start(self):
raise NotImplementedError()

def stop(self):
"""Stop and free any resources required while the backend is running.
"""
"""Stop and free any resources required while the backend is running."""
raise NotImplementedError()

def supports_unbonded(self):
Expand Down Expand Up @@ -54,8 +53,7 @@ def filtered_scan(self, name_filter="", *args, **kwargs):
Returns a list of BLE devices found.
"""
devices = self.scan(*args, **kwargs)
return [device for device in devices
if name_filter in (device['name'] or '')]
return [device for device in devices if name_filter in (device["name"] or "")]

def clear_bond(self, address=None):
raise NotImplementedError()
Expand All @@ -67,6 +65,7 @@ class Characteristic(object):
Only valid for the lifespan of a BLE connection, since the handle values are
dynamic.
"""

def __init__(self, uuid, handle):
"""
Sets the characteritic uuid and handle.
Expand All @@ -86,5 +85,8 @@ def add_descriptor(self, uuid, handle):
self.descriptors[uuid] = handle

def __str__(self):
return "<%s uuid=%s handle=%d>" % (self.__class__.__name__,
self.uuid, self.handle)
return "<%s uuid=%s handle=%d>" % (
self.__class__.__name__,
self.uuid,
self.handle,
)
Loading

0 comments on commit 4e3e97f

Please sign in to comment.