@@ -47,7 +47,7 @@ def __init__(self, timeout: float = 1, security_policy: ua.SecurityPolicy = ua.S
47
47
# needed to pass params from asynchronous request to synchronous data receive callback, as well as
48
48
# passing back the processed response to the request so that it can return it.
49
49
self ._open_secure_channel_exchange : Union [ua .OpenSecureChannelResponse , ua .OpenSecureChannelParameters , None ] = None
50
- # Hook for upperlayer tasks before a request is send (optional)
50
+ # Hook for upper layer tasks before a request is sent (optional)
51
51
self .pre_request_hook : Optional [Callable [[], Awaitable [None ]]] = None
52
52
53
53
def connection_made (self , transport : asyncio .Transport ): # type: ignore
@@ -153,8 +153,8 @@ async def send_request(self, request, timeout: Optional[float] = None, message_t
153
153
"""
154
154
timeout = self .timeout if timeout is None else timeout
155
155
if self .pre_request_hook :
156
- # This will propagade exceptions from background tasks to the libary user before calling a request which will
157
- # timeout then.
156
+ # This will propagate exceptions from background tasks to the library user before calling a request which will
157
+ # time out then.
158
158
await self .pre_request_hook ()
159
159
try :
160
160
data = await asyncio .wait_for (self ._send_request (request , timeout , message_type ), timeout if timeout else None )
@@ -230,7 +230,7 @@ async def open_secure_channel(self, params):
230
230
async def close_secure_channel (self ):
231
231
"""
232
232
Close secure channel.
233
- It seems to trigger a shutdown of socket in most servers, so be prepare to reconnect.
233
+ It seems to trigger a shutdown of socket in most servers, so be prepared to reconnect.
234
234
OPC UA specs Part 6, 7.1.4 say that Server does not send a CloseSecureChannel response
235
235
and should just close socket.
236
236
"""
@@ -310,7 +310,7 @@ async def open_secure_channel(self, params):
310
310
async def close_secure_channel (self ):
311
311
"""
312
312
close secure channel. It seems to trigger a shutdown of socket
313
- in most servers, so be prepare to reconnect
313
+ in most servers, so be prepared to reconnect
314
314
"""
315
315
if not self .protocol or self .protocol .state == UASocketProtocol .CLOSED :
316
316
self .logger .warning ("close_secure_channel was called but connection is closed" )
@@ -485,7 +485,7 @@ async def create_subscription(
485
485
response .Parameters .SubscriptionId
486
486
)
487
487
if not self ._publish_task or self ._publish_task .done ():
488
- # Start the publish loop if it is not yet running
488
+ # Start the publishing loop if it is not yet running
489
489
# The current strategy is to have only one open publish request per UaClient. This might not be enough
490
490
# in high latency networks or in case many subscriptions are created. A Set of Tasks of `_publish_loop`
491
491
# could be used if necessary.
@@ -494,7 +494,7 @@ async def create_subscription(
494
494
495
495
async def inform_subscriptions (self , status : ua .StatusCode ):
496
496
"""
497
- Inform all current subscriptions with a status code. This calls the handlers status_change_notification
497
+ Inform all current subscriptions with a status code. This calls the handler's status_change_notification
498
498
"""
499
499
status_message = ua .StatusChangeNotification (Status = status )
500
500
notification_message = ua .NotificationMessage (NotificationData = [status_message ])
@@ -570,7 +570,7 @@ async def _publish_loop(self):
570
570
continue
571
571
except BadNoSubscription : # See Spec. Part 5, 13.8.1
572
572
# BadNoSubscription is expected to be received after deleting the last subscription.
573
- # We use this as a signal to exit this task and stop sending PublishRequests. This is easier then
573
+ # We use this as a signal to exit this task and stop sending PublishRequests. This is easier than
574
574
# checking if there are no more subscriptions registered in this client (). A Publish response
575
575
# could still arrive before the DeleteSubscription response.
576
576
#
@@ -780,6 +780,6 @@ async def set_publishing_mode(self, params) -> ua.uatypes.StatusCode:
780
780
return response .Parameters .Results
781
781
782
782
async def transfer_subscriptions (self , params : ua .TransferSubscriptionsParameters ) -> List [ua .TransferResult ]:
783
- # Subscriptions aren't bound to a Session and can be transfered !
783
+ # Subscriptions aren't bound to a Session and can be transferred !
784
784
# https://reference.opcfoundation.org/Core/Part4/v104/5.13.7/
785
785
raise NotImplementedError
0 commit comments