aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-07 01:21:53 +0100
committerSam James <sam@gentoo.org>2023-08-07 01:23:18 +0100
commitb0a44ba4c6537921bc4802488c3b01699e25307c (patch)
tree8ee2cd258000e75d11f01446531ecce963c5fd45 /mirrorselect
parentRerun `autopep8` with `--aggressive (diff)
downloadmirrorselect-b0a44ba4c6537921bc4802488c3b01699e25307c.tar.gz
mirrorselect-b0a44ba4c6537921bc4802488c3b01699e25307c.tar.bz2
mirrorselect-b0a44ba4c6537921bc4802488c3b01699e25307c.zip
Rerun `pyupgrade` with `--py39-plus`2.4.0
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'mirrorselect')
-rw-r--r--mirrorselect/extractor.py4
-rw-r--r--mirrorselect/selectors.py19
2 files changed, 10 insertions, 13 deletions
diff --git a/mirrorselect/extractor.py b/mirrorselect/extractor.py
index 8aa495c..4598b8b 100644
--- a/mirrorselect/extractor.py
+++ b/mirrorselect/extractor.py
@@ -47,9 +47,7 @@ class Extractor:
value = getattr(options, opt)
if value is not None:
filters[opt] = value
- self.output.print_info(
- 'Limiting test to "%s=%s" hosts. \n' % (opt, value)
- )
+ self.output.print_info(f'Limiting test to "{opt}={value}" hosts. \n')
for opt in ["ftp", "http", "https"]:
if getattr(options, opt):
filters["proto"] = opt
diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py
index 7f9fddb..bccb2bf 100644
--- a/mirrorselect/selectors.py
+++ b/mirrorselect/selectors.py
@@ -118,7 +118,7 @@ class Shallow:
self.output.write("Done.\n")
self.output.write(
- "\nnetselect(): returning {} and {}\n".format(top_hosts, top_host_dict), 2
+ f"\nnetselect(): returning {top_hosts} and {top_host_dict}\n", 2
)
if quiet:
@@ -154,7 +154,7 @@ class Shallow:
host_dict = self.netselect(block, len(block), quiet=True)[1]
self.output.write(
- "ran netselect(%s, %s), and got %s\n" % (block, len(block), host_dict),
+ f"ran netselect({block}, {len(block)}), and got {host_dict}\n",
2,
)
@@ -292,7 +292,7 @@ class Deep:
self.output.write("deeptest(): final rethost %s\n" % (rethosts), 2)
self.output.write(
- "deeptest(): final md5 failures %s of %s\n" % (self.dl_failures, num_hosts),
+ f"deeptest(): final md5 failures {self.dl_failures} of {num_hosts}\n",
2,
)
self.urls = rethosts
@@ -336,7 +336,7 @@ class Deep:
signal.alarm(0)
except OSError as e:
self.output.write(
- "deeptime(): dns error for host %s: %s\n" % (url_parts.hostname, e),
+ f"deeptime(): dns error for host {url_parts.hostname}: {e}\n",
2,
)
except TimeoutException:
@@ -351,7 +351,7 @@ class Deep:
return (None, True)
self.output.write(
- "deeptime(): ip's for host %s: %s\n" % (url_parts.hostname, str(ips)), 2
+ f"deeptime(): ip's for host {url_parts.hostname}: {str(ips)}\n", 2
)
delta = 0
f = None
@@ -369,8 +369,7 @@ class Deep:
if f is None:
self.output.write(
- "deeptime(): unable to "
- + "connect to host %s\n" % (url_parts.hostname,),
+ "deeptime(): unable to " + f"connect to host {url_parts.hostname}\n",
2,
)
return (None, True)
@@ -416,7 +415,7 @@ class Deep:
"\ndeeptime(): md5sum error for file: %s\n" % self.test_file
+ " expected: %s\n" % self.test_md5
+ " got.....: %s\n" % md5
- + " host....: %s, %s\n" % (url_parts.hostname, ip)
+ + f" host....: {url_parts.hostname}, {ip}\n"
)
self.dl_failures += 1
return (None, True)
@@ -449,7 +448,7 @@ class Deep:
signal.signal(signal.SIGALRM, signal.SIG_DFL)
self.output.write("deeptime(): download completed.\n", 2)
- self.output.write("deeptime(): %s seconds for host %s\n" % (delta, url), 2)
+ self.output.write(f"deeptime(): {delta} seconds for host {url}\n", 2)
return (delta, False)
def _test_connection(self, test_url, url_parts, ip, ips):
@@ -621,7 +620,7 @@ class Interactive:
dialog.extend(
[
"%s" % url,
- "%s%s: %s" % (marker, args["country"], args["name"]),
+ "{}{}: {}".format(marker, args["country"], args["name"]),
"OFF",
]
)