diagnostics: Add DiagnosticCheck dataclass

- Set unique check_id for each diagnostic check.

- Result is a string-based enumeration. The default value (NOT_DONE) can be
  used for diagnostic checks that have not been completed yet.

- Result is StrEnum so that the return value of check_url can still be used
  directly as a diagnostic result.

Closes: #2375

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy committed 2023-10-07 04:52:13 +09:00
1 parent d9491d5762
commit 79f36e6a0c
19 files changed
+284 -183

No files matched your search

+2 -1
View File
@@ -111,7 +111,8 @@ def diagnose_url_with_proxy():
env = {'https_proxy': proxy}
result = diagnose_url(url, kind=address['kind'], env=env)
result[0] = _('Access {url} with proxy {proxy} on tcp{kind}') \
result.description = _(
'Access {url} with proxy {proxy} on tcp{kind}') \
.format(url=url, proxy=proxy, kind=address['kind'])
results.append(result)