Skip to content

Commit 7f48b1e

Browse files
committed
Clean.
1 parent 0dbe304 commit 7f48b1e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pymodbus/file_message.py

Lines changed: 7 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,22 @@ 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:
147+
:return:
147148
"""
148149
self.count = 0
149150
for record in self.records:
150-
self.count+= record.record_length * 2 + 2 if record.record_length else 0
151+
self.count += record.record_length * 2 + 2 if record.record_length else 0
151152

152153
return 2 + self.count
153154

155+
154156
class ReadFileRecordResponse(ModbusResponse):
155157
"""Read file record response.
156158

0 commit comments

Comments
 (0)