4.4. User Settings

Alot sets up a SettingsManager to access user settings defined in different places uniformly. There are four types of user settings:

what? location accessible via
alot config ~/.config/alot/config or given by command option -c. SettingsManager.get()
hooks – user provided python code ~/.config/alot/hooks.py or as given by the hooksfile config value SettingsManager.get_hook()
notmuch config ~/.notmuch-config or given by $NOTMUCH_CONFIG or given by command option -n SettingsManager.get_notmuch_setting()
mailcap – defines shellcommands to handle mime types ~/.mailcap (/etc/mailcap) SettingsManager.mailcap_find_match()

4.4.1. Settings Manager

4.4.2. Errors

exception alot.settings.errors.ConfigError

could not parse user config

exception alot.settings.errors.NoMatchingAccount

No account matching requirements found.

4.4.3. Utils

alot.settings.utils.read_config(configpath=None, specpath=None, checks=None, report_extra=False)

get a (validated) config object for given config file path.

Parameters:
  • configpath (str or list(str)) – path to config-file or a list of lines as its content
  • specpath (str) – path to spec-file
  • checks (dict str->callable,) – custom checks to use for validator. see validate docs
  • report_extra (boolean) – log if a setting is not present in the spec file
Raises:

ConfigError

Return type:

configobj.ConfigObj

alot.settings.utils.resolve_att(a, fallback)

replace ‘’ and ‘default’ by fallback values

4.4.4. Themes

4.4.5. Accounts

4.4.6. Addressbooks

class alot.addressbook.AddressBook(ignorecase=True)

can look up email addresses and realnames for contacts.

Note

This is an abstract class that leaves get_contacts() unspecified. See AbookAddressBook and ExternalAddressbook for implementations.

get_contacts()

list all contacts tuples in this abook as (name, email) tuples

lookup(query='')

looks up all contacts where name or address match query

class alot.addressbook.abook.AbookAddressBook(path='~/.abook/addressbook', **kwargs)

AddressBook that parses abook’s config/database files

Parameters:path (str) – path to abook addressbook file
get_contacts()

list all contacts tuples in this abook as (name, email) tuples