From 2a8b9b94ba650597cd6412ccceb0f57a0958d1da Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Mon, 23 Oct 2023 13:12:15 -0400 Subject: [PATCH] app: Update diagnose() docstring Signed-off-by: James Valleroy [sunil: Add reference documentation for the DiagnosticCheck and Result classes] [sunil: Add link to DiagnosticCheck class from docstring] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- doc/dev/reference/components/index.rst | 9 +++++++++ plinth/app.py | 16 +++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/doc/dev/reference/components/index.rst b/doc/dev/reference/components/index.rst index 52c2e8d42..ad3fd9d97 100644 --- a/doc/dev/reference/components/index.rst +++ b/doc/dev/reference/components/index.rst @@ -33,3 +33,12 @@ Base Classes .. autoclass:: plinth.app.FollowerComponent :members: + +Other Classes +^^^^^^^^^^^^^ + +.. autoclass:: plinth.modules.diagnostics.check.DiagnosticCheck + :members: + +.. autoclass:: plinth.modules.diagnostics.check.Result + :members: diff --git a/plinth/app.py b/plinth/app.py index fef709259..17927270f 100644 --- a/plinth/app.py +++ b/plinth/app.py @@ -211,10 +211,11 @@ class App: def diagnose(self): """Run diagnostics and return results. - Return value must be a list of results. Each result is a two-tuple with - first value as user visible description of the test followed by the + Return value must be a list of results. Each result is a + :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', - 'passed', 'error' and 'warning'. + 'passed', 'error', 'warning' and 'not_done'. Results are typically collected by diagnosing each component of the app and then supplementing the results with any app level diagnostic tests. @@ -303,10 +304,11 @@ class Component: def diagnose(): """Run diagnostics and return results. - Return value must be a list of results. Each result is a two-tuple with - first value as user visible description of the test followed by the - result. The test result is a string enumeration from 'failed', 'passed' - and 'error'. + Return value must be a list of results. Each result is a + :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', + 'passed', 'error', 'warning' and 'not_done'. Also see :meth:`.has_diagnostics`.