Skip to content

Commit

Permalink
[squash] make pylint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxrdv committed Dec 1, 2023
1 parent 260cb93 commit 63a0cca
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scaaml/capture/scope/lecroy/lecroy_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
from struct import pack, unpack
from typing import Optional

import numpy as np

import pyvisa

from scaaml.capture.scope.lecroy.lecroy_waveform import LecroyWaveform
Expand Down Expand Up @@ -208,7 +206,7 @@ def __init__(self, ip_address: str, timeout: float = 5.0):
# sequence_number: byte
# spare: byte = 0 (reserved for future)
# block_length: long = length of the command (block to be sent)
self._s_leCroyCommandHeader = ">BBBBL"
self._lecroy_command_header = ">BBBBL"
self._socket: Optional[socket.socket] = None

@make_custom_exception
Expand Down Expand Up @@ -276,7 +274,7 @@ def query_binary_values(self,
del datatype # ignored
del container # ignored

self._logger.debug(f"\"{message}\"")
self._logger.debug("\"%s\"", message)

# Send message
self.write(message)
Expand All @@ -295,7 +293,7 @@ def _format_command(self, command: str) -> bytes:
"""
# Compute header for the current command, header:
# operation = DATA | EOI
command_header = pack(self._s_leCroyCommandHeader, 129, 1, 1, 0,
command_header = pack(self._lecroy_command_header, 129, 1, 1, 0,
len(command))

formatted_command = command_header + command.encode("ascii")
Expand All @@ -322,7 +320,7 @@ def _get_raw_response(self) -> bytes:
header_version, # unused
sequence_number, # unused
spare, # unused
v_nbTotalBytes) = unpack(self._s_leCroyCommandHeader, header)
total_bytes) = unpack(self._lecroy_command_header, header)

# Delete unused values
del header_version
Expand All @@ -333,9 +331,9 @@ def _get_raw_response(self) -> bytes:
buffer = b""

# Loop until we get all data
while (len(buffer) < v_nbTotalBytes):
while len(buffer) < total_bytes:
buffer += self._socket.recv(
min(v_nbTotalBytes - len(buffer), 8_192))
min(total_bytes - len(buffer), 8_192))

# Accumulate final response
response += buffer
Expand Down

0 comments on commit 63a0cca

Please sign in to comment.