| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
| |
It just adds unnecessary type confusion.
In most places where it is used, the types are always str, so it does
nothing. In the few others, the encoding/decoding is better handled
explicitly.
|
|
|
|
|
|
| |
Python3 only supports "new-style" classes (those extending object),
and we don't need to explicitly inherit from this root class any more.
See http://pylint-messages.wikidot.com/messages:c1001
|
|
|
|
| |
... that opens a new namedqueries buffer
|
|
|
|
| |
They are not needed for python >= 3.0.
|
|
|
|
|
|
| |
.. from "caller" to "ui", as used throughout all subclasses.
The inconsistent naming causes the codacity code checker (pylint) to
complain every time we add a new command subclass.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This can create circular imports in unittests, which causes difficult to
debug errors.
Fixes #1076
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
- use relative imports if possible
- group imports into standard library, third party, and alot modules
- sort imports alphabetically
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
being run
Conflicts:
alot/commands/globals.py
alot/ui.py
|
|
|
|
| |
mostly automatically fixed
|
|
|
|
| |
Commands
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
but are directly set to cmd.pre/posthook by commandfactory.
This still means that these hooks are looked up and stored *in*
the cmd obj in the factory: so whenever FooCommand is instanciated
from within some other commands apply, the hooks are None.
|
| |
|
|
|
|
| |
cf issue #472
|
|
|
|
|
|
|
|
| |
that splits a command string into a list of strings to pass on to subprocess.Popen and the like.
This helper is now used throughout the application instead of calling shlex.split directly as this
is a potential source for errors because shlex is not yet able to properly deal with unicode
bytestrings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
command names alone do not uniquely determine a command
as we do have several differend Commands registered with the same name
but for different modes. pre and post hooks are from now on named
[pre|post]_[modestring]_[commandname].
This commit adjusts the lookup code for command hooks and corrects the
user docs accordingly.
closes #282
|
| |
|
|
|
|
| |
issue #146
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| | |
if the help parameter to the registercommand decorator
is unset, take the classes docstring.
this way one doesn't have to duplicate it for simple commands
|
|/ |
|
|
|
|
| |
issue #137
|
| |
|
| |
|
|
|
|
|
|
| |
and catch ValueError on non-matching quotes.
Explicit quoting in a commandprompt has been
swallowed by shlex before.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|