Skip to content

Commit b1fbea3

Browse files
committed
chore: flake8 string formatting
1 parent acc31b9 commit b1fbea3

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

notecard/notecard.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ def _crc_error(self, rsp_bytes):
177177
seq_number_as_int = int(seq_number, 16)
178178
except ValueError:
179179
if self._debug:
180-
self._debug_fn(f'Received sequence number "{seq_number}" cannot be ' + \
181-
'converted to integer.')
180+
self._debug_fn(f'Received sequence number "{seq_number}" cannot be converted to integer.')
182181
return True
183182
try:
184183
crc_as_int = int(crc, 16)
@@ -201,14 +200,11 @@ def _crc_error(self, rsp_bytes):
201200

202201
if seq_number_as_int != self._last_request_seq_number:
203202
if self._debug:
204-
self._debug_fn('Sequence number mismatch. Expected ' + \
205-
f'{self._last_request_seq_number}, received ' + \
206-
f'{seq_number_as_int}.')
203+
self._debug_fn(f'Sequence number mismatch. Expected {self._last_request_seq_number}, received {seq_number_as_int}.')
207204
return True
208205
elif crc_as_int != computed_crc:
209206
if self._debug:
210-
self._debug_fn(f'CRC error. Computed {computed_crc}, received ' + \
211-
f'{crc_as_int}.')
207+
self._debug_fn(f'CRC error. Computed {computed_crc}, received {crc_as_int}.')
212208
return True
213209

214210
return False
@@ -347,17 +343,15 @@ def Transaction(self, req, lock=True):
347343
if 'err' in rsp_json:
348344
if '{io}' in rsp_json['err'] and '{not-supported}' not in rsp_json['err']:
349345
if self._debug:
350-
self._debug_fn('Response has error field indicating ' + \
351-
f'I/O error: {rsp_json}')
346+
self._debug_fn(f'Response has error field indicating I/O error: {rsp_json}')
352347

353348
error = True
354349
retries_left -= 1
355350
time.sleep(0.5)
356351
continue
357352
elif '{bad-bin}' in rsp_json['err']:
358353
if self._debug:
359-
self._debug_fn('Response has error field indicating ' + \
360-
f'binary I/O error: {rsp_json}')
354+
self._debug_fn(f'Response has error field indicating binary I/O error: {rsp_json}')
361355
self._debug_fn('Not eligible for retry.')
362356

363357
error = True
@@ -540,13 +534,11 @@ def Reset(self):
540534

541535
if not something_found:
542536
if self._debug:
543-
self._debug_fn('Notecard not responding to newline during ' + \
544-
'reset.')
537+
self._debug_fn('Notecard not responding to newline during reset.')
545538

546539
elif non_control_char_found:
547540
if self._debug:
548-
self._debug_fn('Received non-control characters from the ' + \
549-
'Notecard during reset.')
541+
self._debug_fn('Received non-control characters from the Notecard during reset.')
550542
else:
551543
# If all we got back is newlines, we're in sync with the
552544
# Notecard.
@@ -801,13 +793,11 @@ def Reset(self):
801793

802794
if not something_found:
803795
if self._debug:
804-
self._debug_fn('Notecard not responding to newline during ' + \
805-
'reset.')
796+
self._debug_fn('Notecard not responding to newline during reset.')
806797
time.sleep(.005)
807798
elif non_control_char_found:
808799
if self._debug:
809-
self._debug_fn('Received non-control characters from the ' + \
810-
'Notecard during reset.')
800+
self._debug_fn('Received non-control characters from the Notecard during reset.')
811801
else:
812802
# If all we got back is newlines, we're in sync with the
813803
# Notecard.

0 commit comments

Comments
 (0)