summaryrefslogtreecommitdiff
path: root/alot
Commit message (Collapse)AuthorAge
* Merge pull request #957 from fnurl/fnurl-prPatrick Totzke2017-01-13
|\ | | | | Settings for enabling mouse
| * Add a setting for enabling or disabling mouse support.Jody Foo2017-01-13
| | | | | | | | | | | | | | | | | | | | Mouse support is enabled by default. To disable mouse support, set ``` handle_mouse = False ``` in your config file.
* | Merge pull request #964 from dcbaker/pr/fix-962Patrick Totzke2017-01-12
|\ \ | | | | | | alot/completion: revert premature optimization
| * | alot/completion: revert premature optimizationDylan Baker2017-01-12
| | | | | | | | | | | | | | | | | | | | | The change this is partially reverting removed a variable assignment that was actually needed. Fixes #962
* | | Merge pull request #963 from dcbaker/pr/fix-typoPatrick Totzke2017-01-12
|\ \ \ | | | | | | | | alot/commands/globals: fix typo
| * | | alot/commands/globals: fix typoDylan Baker2017-01-12
| |/ / | | | | | | | | | | | | This is a bug, though apparently no one has run into it yet. Found through inspection.
* | | Merge pull request #878 from meskio/encrypt_ccDylan Baker2017-01-12
|\ \ \ | |/ / |/| | Encrypt for the CC addresses too
| * | Encrypt for the CC addresses tooRuben Pollan2017-01-01
| | |
* | | Replace None passed to comprehensions with identity functionDylan Baker2017-01-11
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | One of the differences between map/filter and a comprehension is what happens with None. For map and filter passing None as the function will be treated as an identity function (equivalent to lambda x: x), for comprehensions however, this will raise an exception (calling NoneType). The fix is rather simple, instead of making the default of filtfun None, make it an identity function. I've used lambda x: x since it's easy, although defining an identity function in a utility library might be preferable since lambdas are slower than normal functions. Fixes #946
* | Merge pull request #944 from lucc/argparsePatrick Totzke2017-01-10
|\ \ | | | | | | Replace twisted command line parsing with argparse
| * | Release config files after command line parsingLucas Hoffmann2017-01-10
| | | | | | | | | | | | | | | This was tested with lsof(8) and the files are not open when alot is up and running.
| * | Move default notmuch config path to argparse parser setupLucas Hoffmann2017-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is only possible for the notmuch config file and not for the alot config file as the former is strictly required but the latter is not. If the latter does not exist it will be detected by the argument parser. If the former is not given on the command line the parser will return `None` and we can manually check if the default config file exists and else just skip the alot config file.
| * | Expose more internal commands on the command lineLucas Hoffmann2017-01-10
| | |
| * | Remove unneeded expanduser callsLucas Hoffmann2017-01-10
| | | | | | | | | | | | Fixes the -n option.
| * | Document subcommands in help outputLucas Hoffmann2017-01-10
| | |
| * | Use the internal parser for initial command line parsingLucas Hoffmann2017-01-10
| | | | | | | | | | | | | | | This again sightly changes the help output and also the possible options for the compose subcommand.
| * | Simplify finding of config fileLucas Hoffmann2017-01-10
| | | | | | | | | | | | | | | Especially let the command line parser check if a file given on the command line exists.
| * | Replace twisted command line parsing with argparseLucas Hoffmann2017-01-10
| | | | | | | | | | | | | | | The command line interface is copied as directly as possible. But at least the help output is formatted differently.
* | | Eliminates bug where a modifier + mouse click would crash alot.Jody Foo2017-01-10
|/ / | | | | | | Fixes pazz/alot#955
* | Merge pull request #952 from samdmarshall/masterDylan Baker2017-01-09
|\ \ | | | | | | adding support for mouse scrolling
| * | adding support for mouse scrollingSamantha Marshall2017-01-09
| |/
* / On exit command, check if there are any unsent messagesHamish Downer2017-01-02
|/
* Revert "Fix values to methods in __main__"Dylan Baker2016-12-28
| | | | | | This reverts commit 581ed2987bd456d2894637a30bb5a14a4caa5f9b. Fixes #942
* db/message: fix whitespaceDylan Baker2016-12-27
|
* fix odd continuation and indentationDylan Baker2016-12-27
| | | | This is just whitespace changes.
* db/utils: fix bad hanging indentDylan Baker2016-12-27
|
* db/message: replace __cmp__ with rich comparisonsDylan Baker2016-12-27
| | | | | | | | | | | | | | | | | | | | | | This replaces the deprecated __cmp__ function with the more modern __lt__, __eq__, and __ne__, and then uses functools.total_ordering to implemented the remaining pieces of the rich comparison protocol automatically. It also make use of the NotImplemented singleton, which python uses to signal to rich comparators that this class doesn't no how to compare to the other class, which results in the complementary method from the other class being used, and if both return NotImplemented than a TypeError is generated. There are two reasons to make this change. First, python 3 only supports rich comparisons, and second rich comparisons are much faster than using cmp (and the __cmp__ protocol) because cmp is called at least 3 times per element, while a rich comparitor is called one per element. functools.total_ordering is in the standard library from 2.7 and 3.3, and will implement the rich comparison protocol provided that __eq__ and at least one of __lt__, __le__, __ge__, or __gt__ are implemented. It does not (oddly enough) implement __ne__, so I've implemented that manually.
* db/envelope: add todoDylan Baker2016-12-27
|
* db/envelope: Don't call dunder method when not necessaryDylan Baker2016-12-27
| | | | | | | There are times to call dunder methods explicitly (double underscore methods, like __contains__), but that's usually only required when dealing with inheritance. In this case using the standard 'k in d' syntax is clearer.
* db/attachment: remove useless deleteDylan Baker2016-12-27
| | | | | This dict key is deleted, and then promptly replaced. The deletion is useless, the replacement does the same thing.
* db/attachment: replace all caps name with PEP8 like nameDylan Baker2016-12-27
| | | | | Using file_ instead of FILE still avoids shadowing the builtin, but also doesn't stand out so much.
* ui: Use xrange instead of rangeDylan Baker2016-12-27
| | | | They are the same, except xrange returns an iterator instead of a list.
* commands/utils: Refactor exception caseDylan Baker2016-12-27
| | | | | | | | | This removes the use of range (originally I simply replaced it with xrange, but the realized that the use of range was itself strange), and replaces it with generators and iterators to create the dictionary. This has the advantage of only creating one concrete instance (the choices dict), and being slightly easier to read and understand, as well as not needing to call len() repeatedly.
* Dirty fix for case-(in)sensitive MIME matching.Pol Van Aubel2016-12-26
| | | | | Simply cast every string to lower() when matching MIME media type and subtype. Matching is always case-insensitive as per RFC2045, 5.1.
* Use abc module to signal abstract base classesDylan Baker2016-12-21
| | | | | | | | | | | | | The Completer class is abastract, and it's complete method is also abstract. Using ABCMeta achieve two thing, first it will cause an error if a developer doesn't overwrite the method in a subclass. And second that it tells the static analysis tools to ignore the unused arguments in the signature, since this is the definition of a signature, not an actual function. By the same logic addressbook.AddressBook, and account.Account have been extended to use ABCMeta as their metaclass and have had their abstract methods decorated with the abstract method attribute.
* Replace unused arguments with _Dylan Baker2016-12-21
| | | | | | | | | | This patch replaces a large number (but not all) unused arguments with the standard ``_`` placeholder. This has the advantage of signaling that these values are unused. There are a number of places that I've chosen not to apply this, largely in methods that have publicly define signatures that they inherit (usually from urwid).
* Don't use dict.keys when not necessaryDylan Baker2016-12-21
| | | | | | | | | | | It's pretty easy to get caught up using dict.keys (or iterkeys) when one doesn't need to. This patch corrects two cases where it's not needed, the first is the case of inclusion. ``x in mydict.keys()`` is equivalent to ``x in mydict``, but without the need to generate a list and walk it. The second case is when calling set() on a dict, ``set(mydict)`` will create a set object of the dict's keys, without the need to create one in memory and is significantly faster than ``set(mydict.keys())`` or even ``set(mydict.iterkeys())``.
* ui: Don't build lists in memory for assertDylan Baker2016-12-21
| | | | | | This patch changes an assertion to avoid building a list in memory by using dict.keys() and then concatenating it (building a second list in memory). This is both faster and uses less memory.
* settings/manager: remove list comprehension for clarityDylan Baker2016-12-21
| | | | | | | 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.
* Use dict's iter methodsDylan Baker2016-12-21
| | | | | | | | This patch replaces a number of uses of dict.items, dict.values, and dict.keys with their iterative siblings. The advantage of using the iterator version is that they don't copy the keys, values, or items, but simply return references. This reduces memory usage and may speed up the these operations a bit.
* widgets/search: make method that doesn't use self a static methodDylan Baker2016-12-21
|
* db/thread: Set some protected variables in the constructor.Dylan Baker2016-12-21
|
* db/thread: Avoid intermediate data structureDylan Baker2016-12-21
| | | | | | This patch removes the need to create an intermediate dictionary while calculating the authors of a thread, it does so by working directly with the _authors list.
* db/thread: don't create multiple lists to sortDylan Baker2016-12-21
| | | | | | | | | | | | | | | Currently this function takes a list, splits into two lists based on whether or not a function returns None, sorts the list that isn't None, and then appends the list of None to the end. This creates 4 new concrete lists on each method call, requires the use of 3 filter + lambda pairs, and calls list.sort(). Pretty complicated and inefficient. This patch replaces that with a single sorted() function call with a kay function that replaces None with a value that is guaranteed to sort less than what Message.get_date() will return, but will not cause a comparison to None (which is an error in Python 3.x). This is all based on iterators and avoids the need for filter or list concatenation. This should result in only one new list being created.
* Define instance attribute in constructor.Dylan Baker2016-12-21
|
* Replace map() and filter() with comprehensionsDylan Baker2016-12-21
| | | | | | | | 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.
* Fix "superflous paren" warnings from pylintDylan Baker2016-12-21
| | | | | | | | | In alot/helper.py this is a fairly obvious change. In alot/buffers.py I've taken the liberty of replacing a somewhat odd use of multiplication that relies on the bool class (True and False) implementing an __int__ method. These are used to add the 's' to the end of 'message' if there are more than one message (thus messages), this is much clearer (and more correct) when implemented as a ternary instead.
* Use raw strings with backslashesDylan Baker2016-12-21
| | | | This just adds the `r` prefix to a few strings.
* Fix values to methods in __main__Dylan Baker2016-12-21
| | | | | several of these don't take a self argument. In one case self is needed, in the others decorating them as static methods fixes the behavior.
* tests: Add tests for alot.db.thread.Thread.get_authorDylan Baker2016-12-21
|