summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-12-08 22:13:03 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2011-12-08 22:13:03 +0000
commitb5947fe2018eb9bae8cb1ba2bc358fe3afb94438 (patch)
tree2acb757c76cfb21403cd8a86063eabb725919867 /docs
parenta357c6f3a23c604965d751cc13f2689d08aee81e (diff)
docs for settings
Diffstat (limited to 'docs')
-rw-r--r--docs/database.rst27
-rw-r--r--docs/settings.rst60
2 files changed, 62 insertions, 25 deletions
diff --git a/docs/database.rst b/docs/database.rst
index 683bca46..00334a4b 100644
--- a/docs/database.rst
+++ b/docs/database.rst
@@ -19,24 +19,37 @@ postpone/cache/retry writing operations in case the Xapian index is locked by an
process.
-:class:`DBManager`
----------------------------
+Database Manager
+-----------------
.. autoclass:: DBManager
:members:
-:class:`Thread`
----------------------------
+
+Exceptions
+----------
+.. autoclass:: DatabaseError
+ :members:
+.. autoclass:: DatabaseROError
+ :members:
+.. autoclass:: DatabaseLockedError
+ :members:
+
+Wrapper
+-------
.. autoclass:: Thread
:members:
.. module:: alot.message
-:class:`Message`
----------------------------
.. autoclass:: Message
:members:
-:class:`Attachment`
+
+Other Structures
---------------------------
+
.. autoclass:: Attachment
:members:
+
+.. autoclass:: Envelope
+ :members:
diff --git a/docs/settings.rst b/docs/settings.rst
index ed055719..25d8a68c 100644
--- a/docs/settings.rst
+++ b/docs/settings.rst
@@ -3,10 +3,13 @@ Accessing User Settings
.. module:: alot.settings
-There are three types of user settings: notmuchs and alot's config
-files and the hooks-file for user provided python code.
-Alot sets up :class:`Configparser.ConfigParser` objects for the first two
-and a :class:`HookManager` object to access hooks:
+There are four types of user settings: notmuchs and alot's config
+files, the hooks-file for user provided python code and the mailcap,
+defining shellcomands as handlers for files of certain mime types.
+
+Mime handler can be looked up using :func:`alot.settings.get_mime_handler`.
+Alot sets up :class:`FallbackConfigParser` objects to access the configs
+of alot and notmuch` and a :class:`HookManager` object to access hooks.
+----------------+-----------------------------------+------------------------------+
| What | accessible via | Type |
@@ -15,20 +18,41 @@ and a :class:`HookManager` object to access hooks:
+----------------+-----------------------------------+------------------------------+
| notmuch config | :obj:`alot.settings.notmuchconfig`| :class:`FallbackConfigParser`|
+----------------+-----------------------------------+------------------------------+
-| hooks | :obj:`alot.settings.hooks` | :class:`HooksManager` |
+| hooks | :obj:`alot.settings.hooks` | :class:`HookManager` |
+----------------+-----------------------------------+------------------------------+
Through these objects you can access user settings (or their default values
-if unset) in the following manner:
-
-.. code-block:: python
-
- from alot.settings import config
-
- timeout_int = config.getint('general', 'notify_timeout')
- showbar_bool = config.getboolean('general', 'show_statusbar')
- header_list = config.getstringlist('general', 'displayed_headers')
-
-
-.. automodule:: alot.settings
- :members:
+if unset) in the following manner::
+
+ from alot.settings import config, notmuchconfig
+
+ # alot config
+ >>> config.getint('general', 'notify_timeout')
+ 5
+ >>> config.getboolean('general', 'show_statusbar')
+ True
+ >>> config.getstringlist('general', 'displayed_headers')
+ [u'From', u'To', u'Cc', u'Bcc', u'Subject']
+
+ # notmuch config
+ >>> notmuchconfig.get('user', 'primary_email')
+ 'patricktotzke@gmail.com'
+ >>> notmuchconfig.getboolean('maildir', 'synchronize_flags')
+ True
+
+Hooks can be looked up using :meth:`~HookManager.get` of :obj:`alot.settings.hooks`.
+They are user defined callables that expect to be called with the following parameters:
+
+ :ui: :class:`~alot.ui.UI` -- the initialized main component
+ :dbm: :class:`~alot.db.DBManager` -- :obj:`ui.dbman`
+ :aman: :class:`~alot.account.AccountManager` -- :obj:`ui.accountman`
+ :log: :class:`~logging.Logger` -- :obj:`ui.logger`
+ :config: :class:`AlotConfigParser` :obj:`alot.settings.config`
+
+.. autoclass:: FallbackConfigParser
+ :members:
+.. autoclass:: AlotConfigParser
+ :members:
+.. autoclass:: HookManager
+ :members:
+.. autofunction:: get_mime_handler