1
1
"""Module defining the base class and static func for interfaces."""
2
+
2
3
from abc import ABCMeta , abstractmethod
3
4
from dataclasses import dataclass , field
4
5
from datetime import datetime
@@ -182,12 +183,13 @@ class UOSInterface(metaclass=ABCMeta):
182
183
def execute_instruction (self , packet : NPCPacket ) -> ComResult : # dead: disable
183
184
"""Abstract method for executing instructions on UOSInterfaces.
184
185
185
- :param packet: A tuple containing the uint8 npc packet for the UOS instruction.
186
+ :param packet: A tuple containing the uint8 npc packet for the
187
+ UOS instruction.
186
188
:returns: ComResult object.
187
189
:raises: UOSUnsupportedError if the interface hasn't been built
188
- correctly.
190
+ correctly.
189
191
:raises: UOSCommunicationError if there is a problem completing
190
- the action.
192
+ the action.
191
193
"""
192
194
raise UOSUnsupportedError (
193
195
"UOSInterfaces must over-ride "
@@ -201,12 +203,13 @@ def read_response(
201
203
"""Read ACK and Data packets from a UOSInterface.
202
204
203
205
:param expect_packets: How many packets including ACK to expect
204
- :param timeout_s: The maximum time this function will wait for data.
206
+ :param timeout_s: The maximum time this function will wait for
207
+ data.
205
208
:return: COM Result object.
206
209
:raises: UOSUnsupportedError if the interface hasn't been built
207
- correctly.
210
+ correctly.
208
211
:raises: UOSCommunicationError if there is a problem completing
209
- the action.
212
+ the action.
210
213
"""
211
214
raise UOSUnsupportedError (
212
215
"UOSInterfaces must over-ride "
@@ -219,9 +222,9 @@ def hard_reset(self) -> ComResult:
219
222
220
223
:return: COM Result object.
221
224
:raises: UOSUnsupportedError if the interface hasn't been built
222
- correctly.
225
+ correctly.
223
226
:raises: UOSCommunicationError if there is a problem completing
224
- the action.
227
+ the action.
225
228
"""
226
229
raise UOSUnsupportedError (
227
230
"UOSInterfaces must over-ride "
@@ -233,9 +236,9 @@ def open(self):
233
236
"""Abstract method for opening a connection to a UOSInterface.
234
237
235
238
:raises: UOSUnsupportedError if the interface hasn't been built
236
- correctly.
239
+ correctly.
237
240
:raises: UOSCommunicationError if there is a problem completing
238
- the action.
241
+ the action.
239
242
"""
240
243
raise UOSUnsupportedError (
241
244
"UOSInterfaces must over-ride " f"{ UOSInterface .open .__name__ } prototype."
@@ -246,9 +249,9 @@ def close(self):
246
249
"""Abstract method for closing a connection to a UOSInterface.
247
250
248
251
:raises: UOSUnsupportedError if the interface hasn't been built
249
- correctly.
252
+ correctly.
250
253
:raises: UOSCommunicationError if there is a problem completing
251
- the action.
254
+ the action.
252
255
"""
253
256
raise UOSUnsupportedError (
254
257
"UOSInterfaces must over-ride " f"{ UOSInterface .close .__name__ } prototype."
@@ -260,7 +263,7 @@ def is_active(self) -> bool:
260
263
261
264
:return: Success boolean.
262
265
:raises: UOSUnsupportedError if the interface hasn't been built
263
- correctly.
266
+ correctly.
264
267
"""
265
268
raise UOSUnsupportedError (
266
269
"UOSInterfaces must over-ride " f"{ UOSInterface .close .__name__ } prototype."
@@ -273,7 +276,7 @@ def enumerate_devices() -> list:
273
276
274
277
:return: A list of possible UOSInterfaces on the server.
275
278
:raises: UOSUnsupportedError if the interface hasn't been built
276
- correctly.
279
+ correctly.
277
280
"""
278
281
raise UOSUnsupportedError (
279
282
"UOSInterfaces must over-ride "
0 commit comments