Skip to content

Commit df59550

Browse files
author
Hector Oliveros
committed
Fix ruff format
1 parent 1b840af commit df59550

11 files changed

+21
-23
lines changed

asyncua/client/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ def get_subscription_revised_params(
796796
and new_keepalive_count != params.RequestedMaxKeepAliveCount
797797
):
798798
_logger.info(
799-
"KeepAliveCount will be updated to %s " "for consistency with RevisedPublishInterval",
799+
"KeepAliveCount will be updated to %s for consistency with RevisedPublishInterval",
800800
new_keepalive_count,
801801
)
802802
modified_params = ua.ModifySubscriptionParameters()

asyncua/client/ha/reconciliator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async def update_nodes(self, real_map: SubMap, ideal_map: SubMap, targets: Set[s
219219
# in case the previous create_subscription request failed
220220
if not real_sub:
221221
_logger.warning(
222-
"Can't create nodes for %s since underlying " "subscription for %s doesn't exist", url, sub_name
222+
"Can't create nodes for %s since underlying subscription for %s doesn't exist", url, sub_name
223223
)
224224
continue
225225
vs_real = real_map[url][sub_name]

asyncua/common/connection.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ def create_acknowledge_and_set_limits(self, msg: ua.Hello) -> ua.Acknowledge:
5555
ack.MaxChunkCount = self._select_limit(msg.MaxChunkCount, self.max_chunk_count)
5656
ack.MaxMessageSize = self._select_limit(msg.MaxMessageSize, self.max_message_size)
5757
have_changes = (
58-
self.max_chunk_count != ack.MaxChunkCount or
59-
self.max_recv_buffer != ack.ReceiveBufferSize or
60-
self.max_send_buffer != ack.SendBufferSize or
61-
self.max_message_size != ack.MaxMessageSize
58+
self.max_chunk_count != ack.MaxChunkCount
59+
or self.max_recv_buffer != ack.ReceiveBufferSize
60+
or self.max_send_buffer != ack.SendBufferSize
61+
or self.max_message_size != ack.MaxMessageSize
6262
)
6363
if have_changes:
6464
_logger.info("updating server limits to: %s", self)
@@ -77,10 +77,10 @@ def create_hello_limits(self, msg: ua.Hello) -> ua.Hello:
7777

7878
def update_client_limits(self, msg: ua.Acknowledge) -> None:
7979
have_changes = (
80-
self.max_chunk_count != msg.MaxChunkCount or
81-
self.max_recv_buffer != msg.ReceiveBufferSize or
82-
self.max_send_buffer != msg.SendBufferSize or
83-
self.max_message_size != msg.MaxMessageSize
80+
self.max_chunk_count != msg.MaxChunkCount
81+
or self.max_recv_buffer != msg.ReceiveBufferSize
82+
or self.max_send_buffer != msg.SendBufferSize
83+
or self.max_message_size != msg.MaxMessageSize
8484
)
8585
if have_changes:
8686
_logger.info("updating client limits to: %s", self)
@@ -384,8 +384,7 @@ def _check_sym_header(self, security_hdr):
384384
)
385385
if timeout < datetime.now(timezone.utc):
386386
raise ua.UaError(
387-
f"Security token id {security_hdr.TokenId} has timed out "
388-
f"({timeout} < {datetime.now(timezone.utc)})"
387+
f"Security token id {security_hdr.TokenId} has timed out ({timeout} < {datetime.now(timezone.utc)})"
389388
)
390389
return
391390

@@ -400,7 +399,7 @@ def _check_incoming_chunk(self, chunk):
400399
if chunk.MessageHeader.MessageType != ua.MessageType.SecureOpen:
401400
if chunk.MessageHeader.ChannelId != self.security_token.ChannelId:
402401
raise ua.UaError(
403-
f"Wrong channel id {chunk.MessageHeader.ChannelId}," f" expected {self.security_token.ChannelId}"
402+
f"Wrong channel id {chunk.MessageHeader.ChannelId}, expected {self.security_token.ChannelId}"
404403
)
405404
if self._incoming_parts:
406405
if self._incoming_parts[0].SequenceHeader.RequestId != chunk.SequenceHeader.RequestId:

asyncua/common/copy_node_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async def _read_and_copy_attrs(node_type: asyncua.Node, struct: Any, addnode: ua
118118
setattr(struct, name, variant.Value)
119119
else:
120120
_logger.warning(
121-
"Instantiate: while copying attributes from node type %s," " attribute %s, statuscode is %s",
121+
"Instantiate: while copying attributes from node type %s, attribute %s, statuscode is %s",
122122
str(node_type),
123123
str(name),
124124
str(results[idx].StatusCode),

asyncua/common/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, data, start_pos=0, size=-1):
4343
self._size = size
4444

4545
def __str__(self):
46-
return f"Buffer(size:{self._size}, data:{self._data[self._cur_pos:self._cur_pos + self._size]})"
46+
return f"Buffer(size:{self._size}, data:{self._data[self._cur_pos : self._cur_pos + self._size]})"
4747

4848
__repr__ = __str__
4949

asyncua/common/xmlimporter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ async def add_datatype(self, obj, no_namespace_migration=False):
669669
is_struct = True
670670
else:
671671
_logger.warning(
672-
"%s has datatypedefinition and path %s" " but we could not find out if this is a struct",
672+
"%s has datatypedefinition and path %s but we could not find out if this is a struct",
673673
obj,
674674
path,
675675
)

asyncua/server/history_sql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def read_node_history(self, node_id, start, end, nb_values):
112112
try:
113113
validate_table_name(table)
114114
async with self._db.execute(
115-
f'SELECT * FROM "{table}" WHERE "SourceTimestamp" BETWEEN ? AND ? ' f'ORDER BY "_Id" {order} LIMIT ?',
115+
f'SELECT * FROM "{table}" WHERE "SourceTimestamp" BETWEEN ? AND ? ORDER BY "_Id" {order} LIMIT ?',
116116
(
117117
start_time,
118118
end_time,
@@ -294,7 +294,7 @@ def _get_select_clauses(self, source_id, evfilter):
294294
s_clauses.append(name)
295295
except AttributeError:
296296
self.logger.warning(
297-
"Historizing SQL OPC UA Select Clause Warning for node %s," " Clause: %s:", source_id, select_clause
297+
"Historizing SQL OPC UA Select Clause Warning for node %s, Clause: %s:", source_id, select_clause
298298
)
299299
# remove select clauses that the event type doesn't have; SQL will error because the column doesn't exist
300300
clauses = [x for x in s_clauses if x in self._event_fields[source_id]]

asyncua/server/internal_session.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def __init__(
5959

6060
def __str__(self):
6161
return (
62-
f"InternalSession(name:{self.name},"
63-
f" user:{self.user}, id:{self.session_id}, auth_token:{self.auth_token})"
62+
f"InternalSession(name:{self.name}, user:{self.user}, id:{self.session_id}, auth_token:{self.auth_token})"
6463
)
6564

6665
async def get_endpoints(self, params=None, sockname=None):

asyncua/server/user_managers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async def add_role(self, certificate_path: Path, user_role: UserRole, name: str,
3939

4040
if name in self._trusted_certificates:
4141
logging.warning(
42-
"certificate with name %s " "attempted to be added multiple times, only the last version will be kept.",
42+
"certificate with name %s attempted to be added multiple times, only the last version will be kept.",
4343
name,
4444
)
4545
self._trusted_certificates[name] = {"certificate": uacrypto.der_from_x509(certificate), "user": user}

asyncua/ua/uatypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def __init__(self, Text=None, Locale=None):
786786
if self.Text is not None:
787787
if not isinstance(self.Text, str):
788788
raise ValueError(
789-
f'A LocalizedText object takes a string as argument "text"' f"not a {type(self.Text)}, {self.Text}"
789+
f'A LocalizedText object takes a string as argument "text"not a {type(self.Text)}, {self.Text}'
790790
)
791791

792792
if self.Locale is not None:

tests/test_crypto_connect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ async def test_security_level_endpoints(srv_crypto_all_certs: Tuple[Server, str]
503503
policy_type = ua.SecurityPolicyType.NoSecurity
504504
else:
505505
policy_type = ua.SecurityPolicyType[
506-
f'{end_point.SecurityPolicyUri.split("#")[1].replace("_", "")}_{end_point.SecurityMode.name}'
506+
f"{end_point.SecurityPolicyUri.split('#')[1].replace('_', '')}_{end_point.SecurityMode.name}"
507507
]
508508
assert end_point.SecurityLevel == SECURITY_POLICY_TYPE_MAP[policy_type][2]
509509

0 commit comments

Comments
 (0)