diff -Nru pyacoustid-1.1.2/acoustid.py pyacoustid-1.1.5/acoustid.py --- pyacoustid-1.1.2/acoustid.py 2016-03-08 20:24:05.000000000 +0000 +++ pyacoustid-1.1.5/acoustid.py 2016-12-23 15:51:22.000000000 +0000 @@ -300,7 +300,7 @@ raise FingerprintGenerationError("malformed fpcalc output") if parts[0] == b'DURATION': try: - duration = int(parts[1]) + duration = float(parts[1]) except ValueError: raise FingerprintGenerationError("fpcalc duration not numeric") elif parts[0] == b'FINGERPRINT': @@ -366,9 +366,14 @@ for i, d in enumerate(data): if "duration" not in d or "fingerprint" not in d: raise FingerprintSubmissionError("missing required parameters") - for k, v in d.iteritems(): + for k, v in d.items(): args["%s.%s" % (k, i)] = v response = _api_request(_get_submit_url(), args) - if response['status'] != 'ok': - raise WebServiceError("status: %s" % data['status']) + if response.get('status') != 'ok': + try: + code = response['error']['code'] + message = response['error']['message'] + except KeyError: + raise WebServiceError("response: {0}".format(response)) + raise WebServiceError("error {0}: {1}".format(code, message)) diff -Nru pyacoustid-1.1.2/chromaprint.py pyacoustid-1.1.5/chromaprint.py --- pyacoustid-1.1.2/chromaprint.py 2016-03-08 20:24:05.000000000 +0000 +++ pyacoustid-1.1.5/chromaprint.py 2016-10-29 20:28:57.000000000 +0000 @@ -9,11 +9,11 @@ if sys.version_info[0] >= 3: - BUFFER_TYPES = (memoryview,) + BUFFER_TYPES = (memoryview, bytearray,) elif sys.version_info[1] >= 7: - BUFFER_TYPES = (buffer, memoryview,) + BUFFER_TYPES = (buffer, memoryview, bytearray,) else: - BUFFER_TYPES = (buffer,) + BUFFER_TYPES = (buffer, bytearray,) # Find the base library and declare prototypes. @@ -24,9 +24,11 @@ elif sys.platform == 'win32': return ('chromaprint.dll', 'libchromaprint.dll') elif sys.platform == 'cygwin': - return ('libchromaprint.dll.a', 'cygchromaprint-1.dll', 'cygchromaprint-0.dll') + return ('libchromaprint.dll.a', 'cygchromaprint-1.dll', + 'cygchromaprint-0.dll') return ('libchromaprint.so.1', 'libchromaprint.so.0') + for name in _guess_lib_name(): try: _libchromaprint = ctypes.cdll.LoadLibrary(name) @@ -36,6 +38,7 @@ else: raise ImportError("couldn't find libchromaprint") + _libchromaprint.chromaprint_get_version.argtypes = () _libchromaprint.chromaprint_get_version.restype = ctypes.c_char_p @@ -81,6 +84,7 @@ class FingerprintError(Exception): """Raised when a call to the underlying library fails.""" + def _check(res): """Check the result of a library call, raising an error if the call failed. @@ -88,6 +92,7 @@ if res != 1: raise FingerprintError() + class Fingerprinter(object): ALGORITHM_TEST1 = 0 @@ -134,6 +139,7 @@ _libchromaprint.chromaprint_dealloc(fingerprint_ptr) return fingerprint + def decode_fingerprint(data, base64=True): result_ptr = ctypes.POINTER(ctypes.c_int32)() result_size = ctypes.c_int() @@ -146,6 +152,7 @@ _libchromaprint.chromaprint_dealloc(result_ptr) return result, algorithm.value + def encode_fingerprint(fingerprint, algorithm, base64=True): fp_array = (ctypes.c_int * len(fingerprint))() for i in range(len(fingerprint)): diff -Nru pyacoustid-1.1.2/debian/changelog pyacoustid-1.1.5/debian/changelog --- pyacoustid-1.1.2/debian/changelog 2016-09-03 07:21:20.000000000 +0000 +++ pyacoustid-1.1.5/debian/changelog 2018-11-23 23:24:26.000000000 +0000 @@ -1,3 +1,19 @@ +pyacoustid (1.1.5-1) unstable; urgency=medium + + [ Ondřej Nový ] + * d/control: Set Vcs-* to salsa.debian.org + * d/copyright: Use https protocol in Format field + * d/changelog: Remove trailing whitespaces + * Convert git repository from git-dpm to gbp layout + + [ Sandro Tosi ] + * New maintainer; Closes: 889775 + * New upstream release; Closes: #878623, #881565 + * debian/control + - bump Standards-Version to 4.2.1 (no changes needed) + + -- Sandro Tosi Fri, 23 Nov 2018 18:24:26 -0500 + pyacoustid (1.1.2-2) unstable; urgency=medium * Team upload. @@ -64,7 +80,7 @@ pyacoustid (0.6-1) unstable; urgency=low - * New upstream release + * New upstream release - Drop the backported patch. * Bump the Standards-Version to 3.9.3 * Use the Copyright format 1.0 URL in d/copyright diff -Nru pyacoustid-1.1.2/debian/control pyacoustid-1.1.5/debian/control --- pyacoustid-1.1.2/debian/control 2016-09-03 07:20:30.000000000 +0000 +++ pyacoustid-1.1.5/debian/control 2018-11-23 23:24:26.000000000 +0000 @@ -1,8 +1,8 @@ Source: pyacoustid Section: python Priority: optional -Maintainer: Debian Python Modules Team -Uploaders: Simon Chopin +Maintainer: Sandro Tosi +Uploaders: Debian Python Modules Team Build-Depends: debhelper (>= 9), dh-python, @@ -10,10 +10,10 @@ python3-all, python3-setuptools, python-setuptools -Standards-Version: 3.9.8 +Standards-Version: 4.2.1 Homepage: https://github.com/sampsyo/pyacoustid -Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/pyacoustid.git -Vcs-Browser: https://anonscm.debian.org/cgit/python-modules/packages/pyacoustid.git +Vcs-Git: https://salsa.debian.org/python-team/modules/pyacoustid.git +Vcs-Browser: https://salsa.debian.org/python-team/modules/pyacoustid Package: python-acoustid Architecture: all diff -Nru pyacoustid-1.1.2/debian/copyright pyacoustid-1.1.5/debian/copyright --- pyacoustid-1.1.2/debian/copyright 2016-09-03 07:20:08.000000000 +0000 +++ pyacoustid-1.1.5/debian/copyright 2018-11-23 23:24:26.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pyacoustid Source: https://github.com/sampsyo/pyacoustid @@ -17,6 +17,7 @@ Files: debian/* Copyright: 2011-2014 Simon Chopin + 2018 Sandro Tosi License: Expat License: Expat diff -Nru pyacoustid-1.1.2/debian/.git-dpm pyacoustid-1.1.5/debian/.git-dpm --- pyacoustid-1.1.2/debian/.git-dpm 2016-09-03 07:20:08.000000000 +0000 +++ pyacoustid-1.1.5/debian/.git-dpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# see git-dpm(1) from git-dpm package -64607894384021ae50e9d00fcdbd118f424c0988 -64607894384021ae50e9d00fcdbd118f424c0988 -64607894384021ae50e9d00fcdbd118f424c0988 -64607894384021ae50e9d00fcdbd118f424c0988 -pyacoustid_1.1.2.orig.tar.gz -779f2c828d99be5b0134a0d3ef88174e09d4e0ba -11492 -debianTag="debian/%e%v" -patchedTag="patched/%e%v" -upstreamTag="upstream/%e%u" diff -Nru pyacoustid-1.1.2/PKG-INFO pyacoustid-1.1.5/PKG-INFO --- pyacoustid-1.1.2/PKG-INFO 2016-05-31 17:56:13.000000000 +0000 +++ pyacoustid-1.1.5/PKG-INFO 2017-04-08 16:23:35.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyacoustid -Version: 1.1.2 +Version: 1.1.5 Summary: bindings for Chromaprint acoustic fingerprinting and the Acoustid API Home-page: https://github.com/sampsyo/pyacoustid Author: Adrian Sampson @@ -112,6 +112,18 @@ Version History --------------- + 1.1.5 + Fix compatibility with Python 3 in the `submit` function. + Errors in `submit` are now also handled correctly (i.e., they raise an + informative `WebServiceError` instead of a `TypeError`). + + 1.1.4 + Fix an error on versions of the `fpcalc` tool that report the duration as a + fractional number. + + 1.1.3 + Accept `bytearray` objects in addition to other bytes-like types. + 1.1.2 Fix a possible crash on Unicode text in Python 2 in a non-Unicode locale. Look for version "1" of the Chromaprint shared library file. diff -Nru pyacoustid-1.1.2/pyacoustid.egg-info/pbr.json pyacoustid-1.1.5/pyacoustid.egg-info/pbr.json --- pyacoustid-1.1.2/pyacoustid.egg-info/pbr.json 1970-01-01 00:00:00.000000000 +0000 +++ pyacoustid-1.1.5/pyacoustid.egg-info/pbr.json 2017-04-08 16:23:35.000000000 +0000 @@ -0,0 +1 @@ +{"is_release": false, "git_version": "0d56b1d"} \ No newline at end of file diff -Nru pyacoustid-1.1.2/pyacoustid.egg-info/PKG-INFO pyacoustid-1.1.5/pyacoustid.egg-info/PKG-INFO --- pyacoustid-1.1.2/pyacoustid.egg-info/PKG-INFO 2016-05-31 17:56:13.000000000 +0000 +++ pyacoustid-1.1.5/pyacoustid.egg-info/PKG-INFO 2017-04-08 16:23:35.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyacoustid -Version: 1.1.2 +Version: 1.1.5 Summary: bindings for Chromaprint acoustic fingerprinting and the Acoustid API Home-page: https://github.com/sampsyo/pyacoustid Author: Adrian Sampson @@ -112,6 +112,18 @@ Version History --------------- + 1.1.5 + Fix compatibility with Python 3 in the `submit` function. + Errors in `submit` are now also handled correctly (i.e., they raise an + informative `WebServiceError` instead of a `TypeError`). + + 1.1.4 + Fix an error on versions of the `fpcalc` tool that report the duration as a + fractional number. + + 1.1.3 + Accept `bytearray` objects in addition to other bytes-like types. + 1.1.2 Fix a possible crash on Unicode text in Python 2 in a non-Unicode locale. Look for version "1" of the Chromaprint shared library file. diff -Nru pyacoustid-1.1.2/pyacoustid.egg-info/SOURCES.txt pyacoustid-1.1.5/pyacoustid.egg-info/SOURCES.txt --- pyacoustid-1.1.2/pyacoustid.egg-info/SOURCES.txt 2016-05-31 17:56:13.000000000 +0000 +++ pyacoustid-1.1.5/pyacoustid.egg-info/SOURCES.txt 2017-04-08 16:23:35.000000000 +0000 @@ -8,5 +8,6 @@ pyacoustid.egg-info/PKG-INFO pyacoustid.egg-info/SOURCES.txt pyacoustid.egg-info/dependency_links.txt +pyacoustid.egg-info/pbr.json pyacoustid.egg-info/requires.txt pyacoustid.egg-info/top_level.txt \ No newline at end of file diff -Nru pyacoustid-1.1.2/README.rst pyacoustid-1.1.5/README.rst --- pyacoustid-1.1.2/README.rst 2016-03-08 20:41:58.000000000 +0000 +++ pyacoustid-1.1.5/README.rst 2016-12-23 15:52:22.000000000 +0000 @@ -104,6 +104,18 @@ Version History --------------- +1.1.5 + Fix compatibility with Python 3 in the `submit` function. + Errors in `submit` are now also handled correctly (i.e., they raise an + informative `WebServiceError` instead of a `TypeError`). + +1.1.4 + Fix an error on versions of the `fpcalc` tool that report the duration as a + fractional number. + +1.1.3 + Accept `bytearray` objects in addition to other bytes-like types. + 1.1.2 Fix a possible crash on Unicode text in Python 2 in a non-Unicode locale. Look for version "1" of the Chromaprint shared library file. diff -Nru pyacoustid-1.1.2/setup.py pyacoustid-1.1.5/setup.py --- pyacoustid-1.1.2/setup.py 2016-03-08 20:41:56.000000000 +0000 +++ pyacoustid-1.1.5/setup.py 2016-12-23 15:45:18.000000000 +0000 @@ -31,7 +31,7 @@ setup(name='pyacoustid', - version='1.1.2', + version='1.1.5', description= 'bindings for Chromaprint acoustic fingerprinting and the ' 'Acoustid API',