mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
doc/dev: Remove outdated reference to init() at module level
init() at module level no longer exists and has been replaced with module_loader itself performing equivalent function. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
47cb5e027f
commit
78b08758a3
@ -88,20 +88,4 @@ class later.
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
As soon as FreedomBox Service (Plinth) starts, it will load all the enabled
|
As soon as FreedomBox Service (Plinth) starts, it will load all the enabled
|
||||||
modules. After this, it gives a chance to each of the modules to initialize
|
modules and create app instances for App classes in the module.
|
||||||
itself by calling the ``init()`` method if there is such a method available as
|
|
||||||
``<module>.init()``. The app class must be instantiated here.
|
|
||||||
|
|
||||||
.. code-block:: python3
|
|
||||||
:caption: ``__init__.py``
|
|
||||||
|
|
||||||
app = None
|
|
||||||
|
|
||||||
def init():
|
|
||||||
"""Initialize the Transmission module."""
|
|
||||||
global app
|
|
||||||
app = TransmissionApp()
|
|
||||||
|
|
||||||
setup_helper = globals()['setup_helper']
|
|
||||||
if setup_helper.get_state() != 'needs-setup' and app.is_enabled():
|
|
||||||
app.set_enabled(True)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user