| Commit message (Collapse) | Author | Age |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The typical current message looks like:
unable to load hooks file:/home/teto/.config/alot/hooks.py
without telling why python couldn't load the hook.
This commit prints the exception, thus helping users to solve the issue
(in my case encoding + wrong imports).
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
- allows users to use $XDG_CONFIG_HOME, as well
- stores information in single places.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use fallback, if an enviroment variable is unset *or* empty.
Bug:
- XDG_CONFIG_HOME='' alot
Problem:
Does not find the configuration file (among others), because
os.environ.get('XDG_CONFIG_HOME', '~/.config') returns '', instead of
'~/.config'.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Replace directory check with file check - we only check for a single
file, no need to check for existende of the directory separately. Also,
this way we can distinguish between file validation error and file
not found.
- Be consistent: we stop iterating, if we find a file and it can be
parsed. If we can't parse it, stop iterating as well, don't keep looking
for the file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following crashes:
1. tag completion with regex special chars
:search tag:[<tab>
2. Changing tag representation of an (existing) tag with regex special
chars:
[tags]
[[my**tag]]
normal = '','', 'white','light red', 'white','#d66'
3. Contact completion with regex special chars and no external command:
To:**foo<tab>
|
|\ |
|
| |
| |
| |
| |
| | |
This mostly shortens lines down to <=79 chars and fixes some other small
things I found using the pep8 tool.
|
|/ |
|
|
|
|
|
|
| |
In python3 Exception doesn't have a message attribute, the only way to
get the string output is to call str() on the Exception. This also works
in python 2.7, so go ahead and make that change.
|
|\
| |
| | |
Load default settings even if a user config doesn't exist
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is necessary even if the config file is None to ensure that the
spec file is loaded
Also mock out the setting.const module in the docs, otherwise they'll
fail to generate.
Fixes #1094
|
| |
| |
| |
| |
| | |
SettingsManager sets it's _config attribute to the exact same value
twice in the constructor. This is wrong.
|
|/
|
|
|
| |
This allows to simply pass the content of a messages' From-header value
when determining an account to send/save/encrypt from.
|
|
|
|
|
|
|
| |
This can create circular imports in unittests, which causes difficult to
debug errors.
Fixes #1076
|
|\
| |
| | |
commands/envelope: Fall back to account for signing key
|
| |
| |
| |
| |
| |
| | |
This new return_default flag (which is an optional and default to
False) will try to return the default account if it cannot find an
account matching the address hint.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
This adds additional system locations to search for theme files, which
are either defined as the environment variable XDG_DATA_DIRS, or the
generic fallback (per the xdg base directories spec) as
/usr/local/share and /usr/share. We then add alot/themees to those paths
to search for themes in. This allows a package manager to install the
theme files system wide along with alot, and for alot to load them from
the system wide directories.
The Archlinux alot-git package is already installing the packages like
this.
|
|
|
|
|
|
|
|
|
|
|
| |
This patch does a bit of refactoring to the Settings class for it's
setup, and adds a reload method. The refactoring encapsulates the
handling of NoneType for the read_*config methods, and reworks the
constructor just a bit so that it doesn't rely on calling methods to
create instance variables.
The end result is slightly cleaner, and will be useful for adding a
reload command to alot itself.
|
|
|
|
|
| |
The argument is handed to ConfigObj directly and allowing lines of text
to be passed here makes future tests much easier.
|
|\
| |
| | |
argparse validators
|
| |
| |
| |
| | |
This is just more reorganization.
|
|/ |
|
| |
|
|\
| |
| | |
Porting old doctests to unittest
|
| | |
|
|/ |
|
|
|
|
| |
This is just whitespace changes.
|
|
|
|
|
|
|
| |
The use of a list comprehension here saves one line of code, but doesn't
make the code clearer, a simple loop is more obvious. This also replaces
``if not v or v == ''`` with simply ``if not v``, since they're
equivalent.
|
|
|
|
|
|
|
|
| |
This had the advantage of being more readable to people without a
functional programming background, and it avoids the need to use lambdas
which are both slow and have many corners in python. In a few cases it
also allows us to use a generator expression instead of a materialized
list, which save some memory.
|
|
|
|
| |
This just adds the `r` prefix to a few strings.
|
| |
|
|
|
|
|
|
|
|
|
| |
Configobj's string interpolation feature does not work as expected in
account sections of alot configuration files.
The reason is that interpolation is done in ConfigObj.__getitem__
which alot does not use directly for account sections.
This patch causes all values to be read via ConfigObj.__getitem__
explicitly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are a number of cases of mutable keyword arguments (list and dict
in this case). Mutable keyword arguments are rather dangerous, since any
mutation of the default value is persistent, which will inevitably lead
to bugs.
For example, imagine this code:
def func(def=[]):
def.append('foo')
return def
>>> func()
['foo']
>>> func()
['foo', 'foo']
This is almost certainly not what was intended. This code generally uses
the idiom of setting the default value to None, and then assigning with
or `value = value or []` which will replace value with the empty list
(or dict) when value is falsey, like None or another empty list.
|
|
|
|
|
|
|
| |
I don't think this was correct from the start, since "foo@bar.com" would
match "bfoo@bar.com", even if there was a "bfoo@bar.com" in the
accountmap, depending on the order that they happened to be sorted in
accountmap.
|
| |
|
| |
|