======================================================================
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
- fix typo in method name
- make comment more explicit
- test the case where only one element is in the list
- ignore 0 element case (should test skip(), but 2.6 lacks it)
With those changes they can be used to parse plugin API versions too.
Test cases were modified accordingly.
Main changes:
```python
>>> version_from_string("1.0")
(1, 0, 0, 'final', 0)
>>> version_from_string("1.0.1")
(1, 0, 1, 'final', 0)
```
... based on actual knowledge of how characters are used in practice.
low quotation mark -> normal quotation mark rather than comma
oi should be gha -> gh rather than oi
ideographic punctuation, multiplication / division and middle dot are not punctuation
... whose local knowledge of how characters are actually used identified
more appropriate characters to map to.
soft hyphen -> nothing (since it is invisible)
multiplication -> x rather than * (visually closer)
remove duplicate oe
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.
This new class stores the image data in a tempfile.TemporaryFile so we
don't keep the data for all images that are used somewhere in memory
anymore.
It also deals with saving images onto disk when the corresponding tracks
are saved (this was previously done by the File class). This removes the
ability to use tagger script in the cover file name (cf. the first line
of File._make_image_filename).
This new class stores the image data in a tempfile.TemporaryFile so we
don't keep the data for all images that are used somewhere in memory
anymore.
It also deals with saving images onto disk when the corresponding tracks
are saved (this was previously done by the File class). This removes the
ability to use tagger script in the cover file name (cf. the first line
of File._make_image_filename).
Context menu listing other releases is using main information from release,
often it is enough, but sometimes two or more items in the list are exactly
the same, user have to select each one to determine which is matching for him.
This patch is improving a bit the situation by adding packaging, barcode, or even
disambiguation comment if needed.
As an example, it often happens when a CD is released in jewel case and digipak,
with same label, date, country, barcode, etc..
Use more explicit '[no barcode]' instead of '[none]'.
A test case was added for this feature.
When file has no metadata field indicating the track number, Picard
is trying to guess it from filename, but the simple regex wasn't very efficient.
tracknum_from_filename() does a much better job.
A test case was added.
version_info was renamed PICARD_VERSION
version_string was renamed PICARD_VERSION_STR
short version string is stored in PICARD_VERSION_STR_SHORT (for display)
Hooks can be created to handle upgrades (ie. options renaming), see config.register_upgrade_hook() and config.run_upgrade_hooks()