Skip to content

Commit 9fc62e2

Browse files
committed
Clean.
1 parent e9484ab commit 9fc62e2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pymodbus/file_message.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self, records=None, **kwargs):
9090
:param records: The file record requests to be read
9191
"""
9292
ModbusRequest.__init__(self, **kwargs)
93-
self.records = records or []
93+
self.records = records or []
9494
self.count = 0
9595

9696
def encode(self):
@@ -137,20 +137,21 @@ def execute(self, context): # NOSONAR pylint: disable=unused-argument,no-self-u
137137
# is too big, return an error.
138138
files = []
139139
return ReadFileRecordResponse(files)
140-
140+
141141
def get_response_pdu_size(self):
142-
"""
142+
"""Get response pdu size.
143+
143144
Func_code (1 byte) + Response Byte Count(1 byte) +
144145
N * (File Response Byte Count (1 byte) + Reference Type (1 byte) + 2 * registers to read for file record)
145146
where N = record sub-request count.
146-
:return:
147147
"""
148148
self.count = 0
149149
for record in self.records:
150-
self.count+= record.record_length * 2 + 2 if record.record_length else 0
150+
self.count += record.record_length * 2 + 2 if record.record_length else 0
151151

152152
return 2 + self.count
153153

154+
154155
class ReadFileRecordResponse(ModbusResponse):
155156
"""Read file record response.
156157

0 commit comments

Comments
 (0)