summaryrefslogtreecommitdiff
path: root/docs/source/api/overview.rst
blob: a5ef1e7d369d38e071d208824b4642f56f94dd42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Overview
========

The main component is :class:`alot.ui.UI`, which provides methods for user input and notifications, sets up the widget
tree and maintains the list of active buffers.
When you start up alot, :file:`init.py` initializes logging, parses settings and commandline args
and instanciates the :class:`UI <alot.ui.UI>` instance of that gets passes around later.
From its constructor this instance starts the :mod:`urwid` :class:`mainloop <urwid.main_loop.TwistedEventLoop>`
that takes over.

Apart from the central :class:`UI <alot.ui.UI>`, there are two other "managers" responsible for
core functionalities, also set up in :file:`init.py`:

* :attr:`ui.dbman <alot.ui.UI.dbman>`: a :class:`DBManager <alot.db.DBManager>` to access the email database and
* :attr:`alot.settings.settings`: a :class:`SettingsManager <alot.settings.SettingsManager>` fo access user settings

Every user action, triggered either by keybindings or as input to the commandprompt, is
given as commandline string that gets :func:`translated <alot.commands.commandfactory>`
to a :class:`Command <alot.commands.Command>` object which is then :meth:`applied <alot.ui.UI.apply_command>`.
Different actions are defined as a subclasses of :class:`Command <alot.commands.Command>`, which live
in :file:`alot/commands/MODE.py`, where MODE is the name of the mode (:class:`Buffer <alot.buffers.Buffer>` type) they
are used in.