Commit 64607894 authored by Stefano Rivera's avatar Stefano Rivera

Import pyacoustid_1.1.2.orig.tar.gz

parent 5dc805df
Metadata-Version: 1.1
Name: pyacoustid
Version: 1.1.0
Version: 1.1.2
Summary: bindings for Chromaprint acoustic fingerprinting and the Acoustid API
Home-page: https://github.com/sampsyo/pyacoustid
Author: Adrian Sampson
......@@ -112,6 +112,13 @@ Description: Chromaprint and Acoustid for Python
Version History
---------------
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.
1.1.1
Fix a possible setup error on Python 3 (thanks to Simon Chopin).
1.1.0
Include ``fpcalc.py`` script in source distributions.
Add Python 3 support (thanks to Igor Tsarev).
......
......@@ -104,6 +104,13 @@ used when the Chromaprint library or fpcalc command-line tool cannot be found.
Version History
---------------
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.
1.1.1
Fix a possible setup error on Python 3 (thanks to Simon Chopin).
1.1.0
Include ``fpcalc.py`` script in source distributions.
Add Python 3 support (thanks to Igor Tsarev).
......
......@@ -9,7 +9,7 @@ from __future__ import print_function
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
......@@ -24,6 +24,20 @@ import sys
# http://acoustid.org/
API_KEY = 'cSpUJKpD'
# Python 2/3 Unicode compatibility: this `print_` function forces a
# unicode string into a byte string for printing on Python 2, avoiding
# errors in the process, and does nothing on Python 3, where
# stdout/stderr are text streams (and there's not much we can do about
# that).
if sys.version_info[0] < 3:
def print_(s):
print(s.encode(sys.stdout.encoding, 'replace'))
else:
def print_(s):
print(s)
def aidmatch(filename):
try:
results = acoustid.match(API_KEY, filename)
......@@ -43,9 +57,10 @@ def aidmatch(filename):
first = False
else:
print()
print('%s - %s' % (artist, title))
print('http://musicbrainz.org/recording/%s' % rid)
print('Score: %i%%' % (int(score * 100)))
print_('%s - %s' % (artist, title))
print_('http://musicbrainz.org/recording/%s' % rid)
print_('Score: %i%%' % (int(score * 100)))
if __name__ == '__main__':
aidmatch(sys.argv[1])
......@@ -20,12 +20,12 @@ else:
def _guess_lib_name():
if sys.platform == 'darwin':
return ('libchromaprint.0.dylib',)
return ('libchromaprint.1.dylib', 'libchromaprint.0.dylib')
elif sys.platform == 'win32':
return ('chromaprint.dll', 'libchromaprint.dll')
elif sys.platform == 'cygwin':
return ('libchromaprint.dll.a', 'cygchromaprint-0.dll')
return ('libchromaprint.so.0',)
return ('libchromaprint.dll.a', 'cygchromaprint-1.dll', 'cygchromaprint-0.dll')
return ('libchromaprint.so.1', 'libchromaprint.so.0')
for name in _guess_lib_name():
try:
......
Metadata-Version: 1.1
Name: pyacoustid
Version: 1.1.0
Version: 1.1.2
Summary: bindings for Chromaprint acoustic fingerprinting and the Acoustid API
Home-page: https://github.com/sampsyo/pyacoustid
Author: Adrian Sampson
......@@ -112,6 +112,13 @@ Description: Chromaprint and Acoustid for Python
Version History
---------------
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.
1.1.1
Fix a possible setup error on Python 3 (thanks to Simon Chopin).
1.1.0
Include ``fpcalc.py`` script in source distributions.
Add Python 3 support (thanks to Igor Tsarev).
......
audioread
requests
\ No newline at end of file
requests
......@@ -8,7 +8,7 @@
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
......@@ -16,19 +16,22 @@ import os
import sys
from setuptools import setup
def _read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
data = open(path).read()
if sys.version_info[0] < 3:
data = data.decode('utf8')
data = open(path).read().decode('utf8')
else:
data = open(path, encoding='utf8').read()
# Special case some Unicode characters; PyPI seems to only like ASCII.
data = data.replace(u'\xe1', u'a')
data = data.replace(u'\u0161', u's')
data = data.replace(u'\xfd', u'y')
return data
setup(name='pyacoustid',
version='1.1.0',
version='1.1.2',
description=
'bindings for Chromaprint acoustic fingerprinting and the '
'Acoustid API',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment