Commit Graph

7535 Commits

Author SHA1 Message Date
Philipp Wolfer
3ec9c7c5e4 Merge pull request #1023 from phw/PICARD-637-fix-matchedtracks
PICARD-637: Allow $matchedtracks any number of args
2018-10-31 08:33:46 +01:00
virusMac
8cc47a7680 PICARD-862: Add tests for func_pad, func_replace, func_strip (#1022) 2018-10-31 08:33:02 +01:00
Philipp Wolfer
790c85524c Merge branch 'PICARD-1384-appdata' 2018-10-30 08:39:15 +01:00
abhi-ohri
dd1dc7d4d3 Update Project license syntax 2018-10-30 08:36:24 +01:00
Abhinav Ohri
0d86ce520d Remove unneeded content_attributes. 2018-10-30 08:36:24 +01:00
abhi-ohri
7a4491a8dc Set content_attribute money-purchasing to mild 2018-10-30 08:36:24 +01:00
Abhinav Ohri
57d4152bbd Add Picard screenshot links 2018-10-30 08:36:24 +01:00
Kartik Ohri
4967709f7a Refactor Picard to org.musicbrainz.Picard
The refactoring is in line with the conventions followed by AppData xml.
2018-10-30 08:36:24 +01:00
abhi-ohri
8815c052ed Correct documentation link 2018-10-30 08:34:40 +01:00
abhi-ohri
7485375591 Update setup.py
Specify AppData xml file installation location and refactor Picard.desktop to meet conventions.
2018-10-30 08:34:40 +01:00
abhi-ohri
2b8203df1c Rename picard.desktop to org.musicbrainz.Picard.desktop
Rename file to meet [Freedesktop Desktop Entry Specification](https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html).
2018-10-30 08:34:40 +01:00
abhi-ohri
5101e96bd0 Create org.musicbrainz.Picard.appdata.xml
Add an app description to MusicBrainz Picard. AppStream adds standardized descriptions of applications, that can be used by different application stores and installers.
2018-10-30 08:34:40 +01:00
Wieland Hoffmann
8bb2777bad Remove devutil/__init__.py
It only provided a single function, `printable_node`, for printing XmlNode
objects. These are not really used in Picard anymore since the switch to the
JSON web service.
2018-10-30 08:28:35 +01:00
Philipp Wolfer
b18fbc77b2 Added tests for $matchedtracks 2018-10-29 13:34:02 +01:00
Sophist
fe64b49165 Allow $matchedtracks any number of args ...
... like $noop.

And note that $matchedtracks works only in file naming scripts (which
makes sense).
2018-10-29 12:56:34 +01:00
virusMac
3310f9914e PICARD-1386: Add $title function (#1018)
PICARD-1386: Add $title function
2018-10-29 08:34:54 +01:00
Philipp Wolfer
cf95a77b99 Merge pull request #1014 from phw/PICARD-1383-use-mcn-for-discid-lookup
PICARD-1383: Select release with matching barcode on disc ID lookup
2018-10-26 11:12:21 +02:00
Philipp Wolfer
80eafdc392 PICARD-1391: Avoid exception when closing active requests 2018-10-26 11:11:17 +02:00
Philipp Wolfer
f93a44e00b compare_barcodes: Both None and '' are considered "no barcode" 2018-10-25 08:53:53 +02:00
Philipp Wolfer
1dc800cfc7 Simplify compare_barcodes function 2018-10-25 08:53:53 +02:00
Philipp Wolfer
e94e36eca0 PICARD-1383: Select release with matching barcode on disc ID lookup 2018-10-25 08:53:53 +02:00
Philipp Wolfer
820dd45199 PICARD-1244: Refresh plugin list after (un)installing local plugin 2018-10-25 08:35:16 +02:00
Wieland Hoffmann
a6584d8f9b Merge pull request #1012 from mineo/test-order-1.1
PICARD-1381: Remove dependencies between tests
2018-10-24 17:27:13 +02:00
Wieland Hoffmann
4efc943246 test_acoustid: Extract self.init_test calls to AcoustIDTests setUp()
This is like 365f55c2 for test_acoustid.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
e624aa121c Make PicardTestCase the parent class of all tests
This brings the faketagger and, more importantly, settings reset to all of them.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
624ba7ff7d Always assign config.setting to a copy of the tests settings dictionary
This prevents any setting from leaking between tests.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
5511bc967c WAVTest: Initialize settings
These tests previously relied on config.setting being initialized by some of the
previous format tests, in particular `enabled_plugins`:

---------------------------------------------------- Captured stderr call -----------------------------------------------------
Traceback (most recent call last):
  File "/home/wieland/dev/picard/picard/formats/__init__.py", line 74, in open_
    audio_file = guess_format(filename)
  File "/home/wieland/dev/picard/picard/formats/__init__.py", line 58, in guess_format
    for option in options
  File "/home/wieland/dev/picard/picard/formats/__init__.py", line 57, in <listcomp>
    results = [(option._File.score(filename, fileobj, header), option.__name__, option)
  File "/home/wieland/dev/picard/picard/plugin.py", line 130, in __iter__
    enabled_plugins = config.setting["enabled_plugins"]
KeyError: 'enabled_plugins'
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
eebe00a455 PicardTestCase: Reset config.setting in setUp
This helps finding tests that don't explicitly specify all settings they need.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
dac50a94b3 test_mbjson: Extract self.init_test calls to MBJSONTests setUp()
This is similar to how test_formats does it. It also means that all tests can
inherit setUp() and don't have to super()-call it.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
f01f9299a9 Extract setting up a FakeTagger into a PicardTestCase class 2018-10-23 17:32:50 +02:00
Wieland Hoffmann
3c366c7e36 test_imagelist: Fulfill the assumption that QObject.tagger is a FakeTagger object
Previously, these tests were failing if executed before test_filesystem or
test_format which already did the same:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_imagelist.py:25: in create_test_files
    CoverArtImage(url='file://file1', data=create_fake_png(b'a')),
picard/coverart/image.py:151: in __init__
    self.set_data(data)
picard/coverart/image.py:248: in set_data
    self.datahash = DataHash(data, suffix=self.extension)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <picard.coverart.image.DataHash object at 0x7f367fe036a0>
data = b'\x89PNG\r\n\x1a\naaaaIHDR\x00\x00\x00d\x00\x00\x00da', prefix = 'picard', suffix = '.png'

    def __init__(self, data, prefix='picard', suffix=''):
        self._filename = None
        _datafile_mutex.lock()
        try:
            m = md5()
            m.update(data)
            self._hash = m.hexdigest()
            if self._hash not in _datafiles:
                (fd, self._filename) = tempfile.mkstemp(prefix=prefix, suffix=suffix)
>               QObject.tagger.register_cleanup(self.delete_file)
E               AttributeError: type object 'QObject' has no attribute 'tagger'

picard/coverart/image.py:68: AttributeError
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
55046c7b14 Use pytest and pytest-randomly for running tests on travis
This ensures every test run uses a different execution order for tests, helping
us find dependencies between tests that should be independent.
2018-10-23 17:32:50 +02:00
Philipp Wolfer
ab576a5bb2 Don't use deprecated U file open mode 2018-10-23 11:15:30 +02:00
Philipp Wolfer
6c69347853 Merge pull request #1010 from phw/PICARD-1379-fix-astrcmp-deprecation-warnings
PICARD-1379: Port _astrcmp to new Python Unicode API
2018-10-22 09:21:53 +02:00
Wieland Hoffmann
aadc135403 Merge pull request #1011 from mineo/format-string
Use locale.format_string instead of locale.format
2018-10-20 11:02:01 +02:00
Wieland Hoffmann
22105a74e5 Use locale.format_string instead of locale.format
locale.format is deprecated in favor of locale.format_string since Python 3.7.
locale.format_string is exactly like it with less limitations.
2018-10-19 16:21:09 +02:00
Philipp Wolfer
d739636ee0 Merge pull request #1009 from phw/PICARD-949-keep-recording-ids
PICARD-949: keep recording ids
2018-10-19 15:48:51 +02:00
Philipp Wolfer
beceaf964b _astrcmp: Operate on a UCS4 copy of strings
Ensures thread safety of the LevenshteinDistance call
2018-10-19 00:01:09 +02:00
Philipp Wolfer
69a64bad64 astrcmp: Avoid calls to PyUnicode_READ 2018-10-18 23:43:24 +02:00
Philipp Wolfer
ac8d8049a1 Port _astrcmp to newer Python Unicode API
Requires Python >= 3.3
2018-10-18 23:43:24 +02:00
Philipp Wolfer
55a6c22548 Fix astrcmp_c unit test not being run 2018-10-18 23:43:24 +02:00
Philipp Wolfer
6fd25c7e01 PICARD-1379: Fix PyUnicode_GetSize deprecation warning in astrcmp
Use PyUnicode_GetLength instead of deprecated PyUnicode_GetSize. Requires Python >= 3.3
2018-10-18 23:43:24 +02:00
Philipp Wolfer
5241c32c49 Merge pull request #1006 from phw/PICARD-1339-further-optimizations
PICARD-1339: Further optimizations for update_metadata_images
2018-10-18 22:34:54 +02:00
Philipp Wolfer
8a64804de1 PICARD-1370: Remove Quick Launch shortcut from Windows installer 2018-10-18 20:53:10 +02:00
Philipp Wolfer
8dba1fd7d9 Move can_show_coverart() to Item 2018-10-18 20:51:14 +02:00
Philipp Wolfer
768a873cd1 PICARD-1363: Allow AcoustId submission even if recordingid is unset 2018-10-18 20:37:05 +02:00
Philipp Wolfer
59d4019a11 PICARD-949: Use track original metadata for matching
Makes sure matches by recording ID work even if musicbrainz_recordingid gets unset by scripting or plugins.
2018-10-18 20:22:32 +02:00
Philipp Wolfer
2b4d2106ea PICARD-1313: Unregister extension points when uninstalling a plugin 2018-10-18 20:00:03 +02:00
Philipp Wolfer
b1410780d6 PICARD-1353: Added Travis CI build with xcode7.3 2018-10-18 09:39:06 +02:00
Philipp Wolfer
77f04ba9cc PICARD-1339: Completely avoid coverart updates for UnclusteredFiles 2018-10-17 14:39:28 +02:00