- Fix imports
- Fix pytest issues
- Do not assign lambda as variable
- Use isinstance instead of type to check type
- Rename ambiguously named variables
- Name custom errors with Error suffix
When unix tools make use of an external editor, they typically check the
environment variable VISUAL and fall back to EDITOR. This commit adds the
additional check for VISUAL to the existing EDITOR check (where VISUAL is
preferred over EDITOR).
- Allow user to change UI colors in config file.
- "Change Representation" class allows Albums and Track
matches to reuse similar formatting code
- Functions to split text into lines for printing
- Tests for the new UI to check wrapping functions
- New config option for the importer 'singleton_album_disambig' lets
users choose whether they want to display [album names] in the list of
candidates. Enabled by default but ony applicable if the candidate provides
an album attribute.
- Add docs describing the new option and which source plugins currently support
it.
probably an issue going back to the Python 2 -> 3 switch: `map` gives an
iterator nowadays so after the test case started iterating
BASH_COMPLETION_PATHS, print_completion() couldn't find the
(previously found) bash_completion anymore, and would log a spurious
warning about that.
Also, some cleaup of path type handling
This was a helper for situations when Python 2 and 3 APIs returned bytes
and unicode, respectively. In these situation, we should nowadays know
which of the two we receive, so there's no need to wrap & hide the
`bytes.decode()` anymore (when it is still required).
Detailed justification:
beets/ui/__init__.py:
- command line options are always parsed to str
beets/ui/commands.py:
- confuse's config.dump always returns str
- open(...) defaults to text mode, read()ing str
beetsplug/keyfinder.py:
- ...
beetsplug/web/__init__.py:
- internally, paths are always bytestrings
- additionally, I took the liberty to slighlty re-arrange the code: it
makes sense to split off the basename first, since we're only
interested in the unicode conversion of that part.
test/helper.py:
- capture_stdout() gives a StringIO, which yields str
test/test_ui.py:
- self.io, from _common.TestCase, ultimately contains a
_common.DummyOut, which appears to be dealing with str (cf.
DummyOut.get)