Add a config for isort (https://github.com/timothycrosley/isort)
Run isort -rc . and make import style consistent across files
Add a note about `isort` in CONTRIBUTING.md
The unit tests only consider the string and whether any path component starts with a ".". On Windows the dotfiles are not used for hidden files so the tests fail. To have proper tests on Windows would require to have an actual folder structure with hidden files and folders.
This will allow explicit loading of hidden files, but still will ignore hidden files and folders on deeper levels if the "show_hidden_files" option is disabled.
This fixes PICARD-589 and improves PICARD-528.
======================================================================
ERROR: test_display_tag_name (test.test_utils.TagsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/musicbrainz/picard/test/test_utils.py", line 89, in test_display_tag_name
self.assertEqual(dtn('tag'), 'tag')
File "/home/travis/build/musicbrainz/picard/picard/util/tags.py", line 106, in display_tag_name
return _(name)
NameError: global name '_' is not defined
for punctuation, normalization (merging similar looking characters into
the most common one), accents, and full conversion to ascii.
Functions and tests moved into separate files.
Although more comprehensive, the code should run faster because it
eliminates several loops (inc. a loop with two unicodedata references).
This is intended to form the basis of future PRs to:
a. Clean up (simplify) the file naming code
b. Provide script function(s) for cleaning individual tags / file name
parts
c. Add support for translation / transliteration plugins (which I think
make more sense than being included in Picard itself).
d. Support for converting Tags to ISO-8859-1 rather than ascii (since
that is what is supported by ID3 at least)
e. Possible additional options for allowing / preventing normalization,
possible reorganisation of options to centralise all encoding settings
onto one page rather than metadata, tags and file naming pages at
present (to be discussed).
We had a space-separated list of name,value tuples ("Album 0.5 Other 0.4"),
and two helper functions to load and save data in the correct format
(`load_release_type_scores` and `save_release_type_scores`).
Since option is converted to recently-introduced ListOption, data is now saved
as a list of tuples, eventually converted to dict when needed.
It simplifies code, and also prevents an issue if it comes we have a release group type
with a space in its name.
An upgrade hook was added to handle this change on Picard upgrade.