mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
- This is completely reworked but based on /Developer page in the FreedomBox Manual. - This documentation can be made available as static site on https://docs.freedombox.org and the /Developer page in the FreedomBox Manual can be dropped. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
38 lines
1.3 KiB
ReStructuredText
38 lines
1.3 KiB
ReStructuredText
.. SPDX-License-Identifier: CC-BY-SA-4.0
|
|
|
|
App Module
|
|
----------
|
|
|
|
These methods are optionally provided by the module in which an app is
|
|
implemented and FreedomBox calls/uses them if they are present.
|
|
|
|
<app-module>.init()
|
|
^^^^^^^^^^^^^^^^^^^
|
|
|
|
Optional. This method is called by FreedomBox soon after all the applications
|
|
are loaded. The ``init()`` call order guarantees that other applications that
|
|
this application depends on will be initialized before this application is
|
|
initialized.
|
|
|
|
<app-module>.diagnose()
|
|
^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
Optional. Called when the user invokes system-wide diagnostics by visiting
|
|
**System -> Diagnositcs**. This method must return an array of diagnostic
|
|
results. Each diagnostic result must be a two-tuple with first element as a
|
|
string that is shown to the user as name of the test and second element is the
|
|
result of the test. It must be one of ``passed``, ``failed``, ``error``. Example
|
|
return value:
|
|
|
|
.. code-block:: python3
|
|
|
|
[('Check http://localhost/app is reachable', 'passed'),
|
|
('Check configuration is sane', 'passed')]
|
|
|
|
<app-module>.depends
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
Optional. This module property must contain a list of all apps that this
|
|
application depends on. The application is specified as string containing the
|
|
full module load path. For example, ``names``.
|