Components¶
Available components:
Base Classes¶
-
class
plinth.app.
Component
(component_id)[source]¶ Interface for an app component.
app_id is a string which is set to the value of the application’s app_id to which this component belongs. It is set when the component is added to an app. When the component is removed from an app, it set to None.
-
property
app
¶ Return the app this component is part of.
Raises KeyError if this component is not part of any app.
-
static
diagnose
()[source]¶ 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’.
Also see
has_diagnostics()
.
-
has_diagnostics
()[source]¶ Return whether at least one diagnostic test is implemented.
If this method return True, the
App.has_diagnostics()
. also returns True.If a subclass of Component overrides the
diagnose()
method, it is assumed that it is for implementing diagnostic tests and this method returns True for such a component. Override this method if this default behavior does not fit the needs.
-
property
-
class
plinth.app.
LeaderComponent
(component_id)[source]¶ Interface for an app component that decides the state of the app.
These components determine if the app is enabled or not.