Commit Graph

7535 Commits

Author SHA1 Message Date
Philipp Wolfer
a1313bef84 PEP8 fixes 2019-03-28 11:45:42 +01:00
Philipp Wolfer
3b3980adb0 Added tests for technical file info tags 2019-03-28 11:45:42 +01:00
Philipp Wolfer
8fdfcf1ffe Restructure format tests into separate files 2019-03-28 11:10:06 +01:00
Philipp Wolfer
ce64b9c944 NSIS: Localize uninstaller options 2019-03-28 07:45:45 +01:00
Laurent Monin
f5b7189d07 ScriptExpression.eval(): use list comprehension instead a for/append loop 2019-03-28 00:19:16 +01:00
Laurent Monin
b0445c0400 PEP8: Capitalize TagStatus class constants
Those aren't define at module level, but they are still meant to be constants
https://www.python.org/dev/peps/pep-0008/#constants
2019-03-27 18:10:32 +01:00
Laurent Monin
a39b65f41d Merge pull request #1152 from zas/coverart_stuff_cleanup
Coverart stuff cleanup
2019-03-27 17:57:23 +01:00
bovirus
cc1decb73d NSIS: Fixed language in Italian installer 2019-03-27 16:41:09 +01:00
Philipp Wolfer
24782608b3 NSIS: Escape single quotes in Italian translation 2019-03-27 15:40:46 +01:00
Philipp Wolfer
ab1adf15cb Add common tests for Vorbis formats 2019-03-27 15:05:47 +01:00
Laurent Monin
0688498487 Slightly improve debug output concerning available/enabled providers
Example of output:
 CA Providers order: Cover Art Archive [ ] > Whitelist [ ] > CaaReleaseGroup [x] > Local [ ] > Amazon [x]
2019-03-27 14:35:29 +01:00
Laurent Monin
943108518c Register cover art retrieve function directly in picard.coverart file
- no need to import in picard.album
- rename coverart() to _retrieve_coverart()
2019-03-27 14:35:29 +01:00
Laurent Monin
044b72fd02 Get rid of pre-2.0 'queue_downloads' compatibility code 2019-03-27 14:35:29 +01:00
Laurent Monin
300138b67f Remove is_provider_enabled() which isn't needed anymore
Re-implement CoverArtProvider.enabled() with a sensible default

See https://github.com/metabrainz/picard/pull/1152/files#r269425834
2019-03-27 14:35:30 +01:00
Laurent Monin
21577f8b3f Better handling of undefined NAME & TITLE in CoverArtProvider subclasses
- provide name & title "class" properties, which provide sensible defaults
- remove direct access to NAME & TITLE
- fix a potential issue in register_cover_art_provider(): missing TITLE was causing it to fail, while it was handled elsewhere
2019-03-27 14:35:29 +01:00
Laurent Monin
444bed8970 Rework cover art providers, moving most logic in cover_art_providers()
- convert to a generator
- use defaultdict to order providers, replacing function/try/except
- use namedtuples to self-document the process
- simplify and clarify main loop
- yield (name, title, position, class), as those are needed in various places
- drop the need to call CoverArtProvider.enabled() in subclasses; since the check is now done in main loop
2019-03-27 14:35:29 +01:00
bovirus
00a3163ddb Enable Italian language 2019-03-27 09:31:37 +01:00
bovirus
e1a7500b5c Add installer italian language 2019-03-27 09:13:56 +01:00
Philipp Wolfer
8e613f64ce Merge pull request #1151 from phw/PICARD-1468-localize-nsis
PICARD-1468: Localize NSIS installer
2019-03-27 06:17:05 +00:00
Laurent Monin
b80f433385 Merge pull request #1150 from phw/PICARD-1492-fix-vorbis-rating-email-with-invalid-chars
PICARD-1492: Fix saving Vorbis ratings with invalid chars in user e-mail
2019-03-27 01:18:02 +01:00
Laurent Monin
4345958540 Merge pull request #1145 from zas/oauth_cleanup
Oauth cleanup: use properties
2019-03-27 00:04:53 +01:00
Philipp Wolfer
cf9528bd86 PICARD-1492: Added tests and docs for vorbis.sanitize_key 2019-03-26 16:06:08 +01:00
Laurent Monin
aaea31b1e8 Use kw argument for callback returned value 2019-03-26 11:49:33 +01:00
Laurent Monin
d990fc801a Make use of kw argument access_token for callback
This one ends to call back a method defined as:
def _send_request(self, request, access_token=None)

and passed as callback using partial(self._send_request, request)
2019-03-26 11:49:33 +01:00
Laurent Monin
16385ea461 OAuthManager: use @property.deleter instead of setting to None 2019-03-26 11:47:47 +01:00
Laurent Monin
9f93047495 OAuthManager: store config.persist in persist property 2019-03-26 11:47:47 +01:00
Laurent Monin
b2a8ddcd93 OAuthManager: introduce username property 2019-03-26 11:47:47 +01:00
Laurent Monin
cc1b26bc08 OAuthManager: introduce access_token and access_token_expires properties 2019-03-26 11:43:58 +01:00
Laurent Monin
d91bf51204 OAuthManager: introduce refresh_token and refresh_token_scopes properties
- it prevents direct use of config.persist
- setting properties to None executes config.persist.remove()
2019-03-26 11:42:16 +01:00
Laurent Monin
4c49788769 Reduce code redundancy, new properties: host & port 2019-03-26 11:40:51 +01:00
Laurent Monin
277897b9f0 Merge pull request #1148 from zas/versions_count
PICARD-1496: display count of Other versions in menu and refactoring
2019-03-26 10:45:54 +01:00
Philipp Wolfer
2d98026c22 PICARD-1492: Fix saving Vorbis ratings with invalid chars in user e-mail 2019-03-26 09:24:56 +01:00
Philipp Wolfer
3a2cfc3a89 Fix ASFFile._save modifying passed metadata 2019-03-26 07:32:59 +00:00
Philipp Wolfer
601df7b158 Simpified initializing Metadata() in formats tests 2019-03-26 07:32:59 +00:00
Laurent Monin
22a1a104fd Merge pull request #1146 from zas/pylint_cleanup
Pylint errors/warnings cleanup
2019-03-25 21:43:22 +01:00
Laurent Monin
42f6cfb38a Use tuples of integers and heapq instead strings/sort/list/dict for menu ordering
- old code was a bit tricky, concatenating special prefix to name to order
- use a heapq so entries are sorted on insert
- rename few local variables to make them more explicit
- use "constants" ORDER_BEFORE and ORDER_AFTER instead of "0", "?"
- review behavior with countries/formats & preferences, making the code easier to understand
- simplify "grouping": we add a separator after each group
2019-03-25 18:21:26 +01:00
Laurent Monin
f2823f165d Merge pull request #1147 from zas/fix_country_list
Fix country list
2019-03-25 17:57:09 +01:00
Laurent Monin
c80ae1344b Name countries-related tests, classes and variables consistently 2019-03-25 14:40:52 +01:00
Laurent Monin
a458bbe2ff country_list_from_node() -> countries_from_node() 2019-03-25 14:38:51 +01:00
Laurent Monin
a930e688e3 country_list_from_node(): country -> countries
That's a list of countries.
2019-03-25 14:36:56 +01:00
Laurent Monin
f9e1373d9a country_list_from_node(): returns [] instead of implicit None if no release-event in node
Since this code was introduced in f8559fdd7, it was returning None implicitly if no "release-events" were found in node.
This behavior differs from other methods of the same kind like release_dates_and_countries_from_node()

This change shouldn't have any negative impact, since callers always test for emptyness
2019-03-25 14:36:56 +01:00
Laurent Monin
5ae92454f4 Add a test for release without events vs countries 2019-03-25 14:36:56 +01:00
Laurent Monin
8fe3ee23d8 Address PyLint W0105: convert to valid docstrings, they have to be at top 2019-03-25 13:11:38 +01:00
Laurent Monin
95eb1c8904 Fix PyLint W0221: use a property instead of passing a parameter, no use outside this file
picard/webservice/__init__.py:218:4: W0221: Parameters differ from overridden '_init_headers' method (arguments-differ)
picard/webservice/__init__.py:229:4: W0221: Parameters differ from overridden '_init_headers' method (arguments-differ)
picard/webservice/__init__.py:238:4: W0221: Parameters differ from overridden '_init_headers' method (arguments-differ)
picard/webservice/__init__.py:247:4: W0221: Parameters differ from overridden '_init_headers' method (arguments-differ)
2019-03-25 13:11:38 +01:00
Laurent Monin
3d38e39a1f Fix PyLint R1704: rename local a & b to av & bv
picard/similarity.py:55:8: R1704: Redefining argument with the local name 'a' (redefined-argument-from-local)
picard/similarity.py:58:22: R1704: Redefining argument with the local name 'b' (redefined-argument-from-local)
2019-03-25 13:11:38 +01:00
Laurent Monin
6b1b97e41b Fix PyLint W0221: Mapping.get() is using key not name
picard/metadata.py:307:4: W0221: Parameters differ from overridden 'get' method (arguments-differ)

https://hg.python.org/cpython/file/3.5/Lib/_collections_abc.py#l594
2019-03-25 13:11:38 +01:00
Laurent Monin
42b0cdcd17 Fix PyLint W0611: import is unused because code is using picard.api_versions not api_versions
picard/plugin.py:35:0: W0611: Unused api_versions imported from picard (unused-import)
2019-03-25 13:11:38 +01:00
Laurent Monin
7c1f5efcad Fix PyLint R0201 and R0203
picard/formats/mutagenext/tak.py:45:4: R0201: Method could be a function (no-self-use)
picard/formats/mutagenext/tak.py:55:4: R0203: Consider using a decorator instead of calling staticmethod (no-staticmethod-decorator
2019-03-25 13:11:38 +01:00
Laurent Monin
cad2ffdb9b Append number of alternative versions to Other versions menu label
"Other versions" before download or when no alternative versions exist
"Other versions (#)" after download and when more than one alternative versions exist
2019-03-25 09:00:51 +01:00
Laurent Monin
f0adc86f89 Disable PyLint C0123, this is intentional as explained in the comment 2019-03-24 17:48:59 +01:00