app: Update diagnose() docstring

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Add reference documentation for the DiagnosticCheck and Result classes]
[sunil: Add link to DiagnosticCheck class from docstring]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2023-10-23 13:12:15 -04:00 committed by Sunil Mohan Adapa
parent 520ce34e7c
commit 2a8b9b94ba
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 18 additions and 7 deletions

View File

@ -33,3 +33,12 @@ Base Classes
.. autoclass:: plinth.app.FollowerComponent .. autoclass:: plinth.app.FollowerComponent
:members: :members:
Other Classes
^^^^^^^^^^^^^
.. autoclass:: plinth.modules.diagnostics.check.DiagnosticCheck
:members:
.. autoclass:: plinth.modules.diagnostics.check.Result
:members:

View File

@ -211,10 +211,11 @@ class App:
def diagnose(self): def diagnose(self):
"""Run diagnostics and return results. """Run diagnostics and return results.
Return value must be a list of results. Each result is a two-tuple with Return value must be a list of results. Each result is a
first value as user visible description of the test followed by the :class:`~plinth.modules.diagnostics.check.DiagnosticCheck` with a
unique check_id, a user visible description of the test, and the
result. The test result is a string enumeration from 'failed', result. The test result is a string enumeration from 'failed',
'passed', 'error' and 'warning'. 'passed', 'error', 'warning' and 'not_done'.
Results are typically collected by diagnosing each component of the app Results are typically collected by diagnosing each component of the app
and then supplementing the results with any app level diagnostic tests. and then supplementing the results with any app level diagnostic tests.
@ -303,10 +304,11 @@ class Component:
def diagnose(): def diagnose():
"""Run diagnostics and return results. """Run diagnostics and return results.
Return value must be a list of results. Each result is a two-tuple with Return value must be a list of results. Each result is a
first value as user visible description of the test followed by the :class:`~plinth.modules.diagnostics.check.DiagnosticCheck` with a
result. The test result is a string enumeration from 'failed', 'passed' unique check_id, a user visible description of the test, and the
and 'error'. result. The test result is a string enumeration from 'failed',
'passed', 'error', 'warning' and 'not_done'.
Also see :meth:`.has_diagnostics`. Also see :meth:`.has_diagnostics`.