| Commit message (Collapse) | Author | Age |
|
|
|
| |
This is needed by unittest that mock Thread.refresh.
|
|
|
|
|
|
|
|
| |
The safely_get helper is just a wrapper around try/except, and is used
twice in the whole code base, in the same function. It really doesn't
even end up saving code because to get around line wrapping a lambda is
assigned (which is not the greatest style wise), it ends up saving one
line of code when it's called, and the function itself is 16 lines long.
|
| |
|
|\
| |
| | |
Use with blocks to write to temp files
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Save command line history across sessions
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The option allows to limit the size of recent command line entries that are
store on disk.
|
| |
| |
| |
| |
| |
| | |
Initialize the command history with lines from
${XDG_CACHE_HOME:-~/.cache}/alot at startup. Write the current history to the
file again during shutdown.
|
| |
| |
| |
| |
| |
| |
| |
| | |
While open().read() is nice for its terseness it has the problem that it
causes an fd to leak until the gc collects it. For short lived scripts
this isn't a big deal, but for a program like alot that run for long
periods of time it's better to be correct and ensure that the fd is
closed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This uses open() as a context manager instead of calling close()
explicitly. This has the advantage of closing even in the event of an
exception, being easier to visually inspect for correctness, and being
the more modern idiom.
This does leave one case of file.close(), where FILE is opened in an if
tree.
|
|\ \
| |/
|/| |
Small fixes found with pylint
|
| | |
|
| |
| |
| |
| | |
This will also make the string interpolation lazy evaluated.
|
| |
| |
| |
| | |
The lower case version is available since 2.5.
|
| | |
|
|/ |
|
|
|
|
| |
This is the default value.
|
|
|
|
|
| |
It's more efficient to use a generator here than a list comprehension,
since then we can avoid calculating addresses we don't need.
|
| |
|
|
|
|
|
|
|
| |
Instead of using set([l for l in list]) use {l for l in list} (which
shouldn't be confused with a dict comprehension which requires the ':'
in the first value}. This avoids creating a list before reducing it to a
set. This feature is new in 2.7 and 3.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
It would otherwise be picked up by the autogenerated docs.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
- use relative imports if possible
- group imports into standard library, third party, and alot modules
- sort imports alphabetically
|
| |
|
|
|
|
|
| |
`del` and `return` are keywords and not functions so the braces are not
needed.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Default value 'first_message' lists authors in the order they joined the
conversation. Value 'latest_message' order authors by their latest
message, which makes it easier to see which authors who wrote the most
recent messages.
Note that authors with duplicate emails were previously filtered. We now
keep all authors where name + email is unique. This is behavior is
desired for some email notification services. For example, Jira will
set the From header to "Joe User <jira@company.com>" meaning you will
only see one author if you only keep unique email addresses.
|
|\
| |
| | |
Allow specifing the mailcap field key for `pipeto`
|
| |
| |
| |
| |
| | |
When decoding the message, use the mailcap field specified for command
lookup.
|
|\ \
| | |
| | | |
Removed incorrect backslash-t substitution in envelope.
|
| | | |
|
| | | |
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Refreshing non-search buffers (eg the thread view) can have undesired
effects. This defensively only refreshes when the search
buffer is visible. (fixes #871)
Signed-off-by: Dimitrios Semitsoglou-Tsiapos <kmhzsem@gmx.com>
|
|\ \ \ |
|
| | | | |
|
| | | | |
|
| | | | |
|