aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/archiveresolver.py
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2022-06-22 15:09:08 +0300
committerPatrik Teivonen <patrik.teivonen@qt.io>2022-08-16 09:23:54 +0000
commit25a59a540a652511f38425a31130dcd85b105166 (patch)
tree3d95c0c7238606a9e8f07d2ac4db598b90448743 /packaging-tools/archiveresolver.py
parent08d6d621822c803d41359348133bd37eae5f370d (diff)
pylint: Add string formatting checks, use f-string and lazy % formatting
Enable following checks in pylint: - C0209: Formatting a regular string which could be a f-string - W1202: Use lazy % formatting in logging functions - W1203: Use lazy % formatting in logging functions Use f-string for string formatting where recommended and lazy % formatting in logging. Change-Id: I14924d27e0f800c47af1ec903be4c51f24191d26 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
Diffstat (limited to 'packaging-tools/archiveresolver.py')
-rw-r--r--packaging-tools/archiveresolver.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/packaging-tools/archiveresolver.py b/packaging-tools/archiveresolver.py
index 4ee16be05..8f63615f8 100644
--- a/packaging-tools/archiveresolver.py
+++ b/packaging-tools/archiveresolver.py
@@ -108,7 +108,7 @@ class ArchiveLocationResolver:
for server in self.server_list:
if server.server_name == server_name:
return server.server_url
- raise RuntimeError('*** Error! Unable to find server by name: %s' % server_name)
+ raise RuntimeError(f"*** Error! Unable to find server by name: {server_name}")
###############################
# Get full server URI
@@ -145,7 +145,7 @@ class ArchiveLocationResolver:
else:
parts = urlparse(archive_uri)
if parts.scheme and parts.netloc:
- raise RuntimeError("Url: [%s] points to valid location but it is inaccessible." % (archive_uri))
+ raise RuntimeError(f"Url: [{archive_uri}] points to valid location but it is inaccessible.")
# 3. try to compose full URL
temp = self.server_url_by_name(server_name)
if not temp.endswith('/') and not archive_uri.startswith('/'):
@@ -161,5 +161,5 @@ class ArchiveLocationResolver:
print(' Server list:')
for server in self.server_list:
print(' ---------------------------------------------')
- print(' Server name: ' + server.server_name)
- print(' Server url: ' + server.server_url)
+ print(f' Server name: {server.server_name}')
+ print(f' Server url: {server.server_url}')