Skip to content

Commit 356ce31

Browse files
committed
fix: refine by ruff suggesstion
1 parent 21db18b commit 356ce31

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

dlt/dlt.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __del__(self):
9595
raise RuntimeError("Could not cleanup DLTFilter")
9696

9797
def __repr__(self):
98-
"""return the 'official' string representation of an object"""
98+
"""Return the 'official' string representation of an object"""
9999
apids = [ctypes.string_at(entry[:DLT_ID_SIZE]) for entry in self.apid]
100100
ctids = [ctypes.string_at(entry[:DLT_ID_SIZE]) for entry in self.ctid]
101101

@@ -287,7 +287,6 @@ def __setstate__(self, state):
287287
@staticmethod
288288
def from_bytes(data):
289289
"""Create a class instance from a byte string in DLT storage format"""
290-
291290
msg = DLTMessage()
292291
storageheader, remainder = msg.extract_storageheader(data)
293292

@@ -863,7 +862,8 @@ def __len__(self):
863862

864863
class DLTClient(cDltClient):
865864
"""DLTClient class takes care about correct initialization and
866-
cleanup"""
865+
cleanup
866+
"""
867867

868868
verbose = 0
869869

@@ -1076,7 +1076,8 @@ def py_dlt_file_main_loop(dlt_reader, limit=None, callback=None):
10761076
# pylint: disable=too-many-arguments,too-many-return-statements,too-many-branches
10771077
def py_dlt_client_main_loop(client, limit=None, verbose=0, dumpfile=None, callback=None):
10781078
"""Reimplementation of dlt_client.c:dlt_client_main_loop() in order to handle callback
1079-
function return value"""
1079+
function return value
1080+
"""
10801081
bad_messages = 0
10811082
while True:
10821083
if bad_messages > 100:

dlt/dlt_broker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (C) 2015. BMW Car IT GmbH. All rights reserved.
22
"""DLT Broker is running in a loop in a separate thread until stop_flag is set and adding received messages
3-
to all registered queues"""
3+
to all registered queues
4+
"""
45
from contextlib import contextmanager
56
import ipaddress as ip
67
import logging
@@ -64,7 +65,6 @@ def __init__(
6465
:param bool ignore_filter_set_ack_timeout: Ignore the timeout when the value is True
6566
:param **kwargs: All other args passed to DLTMessageHandler
6667
"""
67-
6868
# - dlt-time share memory init
6969
self._dlt_time_value = DLTTimeValue() if enable_dlt_time else None
7070

dlt/dlt_broker_handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ def break_blocking_main_loop(self):
304304
If it could constantly dispatch messages, then the main loop will not get into blocking state.
305305
Only when no more message could not be dispatched, the main loop would get into blocking state.
306306
307-
Not all message dispatchers need to implement this method"""
307+
Not all message dispatchers need to implement this method
308+
"""
308309
pass
309310

310311

tests/dlt_broker_time_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def fake_py_dlt_client_main_loop(client, callback, *args, **kwargs):
2020
@contextmanager
2121
def dlt_broker(pydlt_main_func=fake_py_dlt_client_main_loop, enable_dlt_time=True, enable_filter_set_ack=False):
2222
"""Initialize a fake DLTBroker"""
23-
2423
with patch("dlt.dlt_broker_handlers.DLTMessageHandler._client_connect"), patch(
2524
"dlt.dlt_broker_handlers.py_dlt_client_main_loop", side_effect=pydlt_main_func
2625
):
@@ -224,7 +223,6 @@ def test_add_context_with_ack_warning():
224223

225224
def test_start_stop_dlt_filter_ack_msg_handler():
226225
"""Test to start/stop DLTFilterAckMessageHandler normally"""
227-
228226
with dlt_filter_ack_msg_handler() as (handler, _):
229227
pass
230228

0 commit comments

Comments
 (0)