commit python3-pylast for openSUSE:Factory
Hello community, here is the log from the commit of package python3-pylast for openSUSE:Factory checked in at 2015-09-30 05:52:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-pylast (Old) and /work/SRC/openSUSE:Factory/.python3-pylast.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-pylast" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-pylast/python3-pylast.changes 2015-05-10 10:47:40.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-pylast.new/python3-pylast.changes 2015-09-30 05:52:23.000000000 +0200 @@ -1,0 +2,36 @@ +Sun Sep 27 01:36:38 UTC 2015 - arun@gmx.de + +- update to version 1.4.2 + * (no changelog available) + +- changes from version 1.4.0: + * Fix get_recent_tracks (and more) + +- update to version 1.3.0: + * Let Tox use these env vars + * get_tagged_tracks: Use cacheable param + * flake8 + * pep8 compliance + * Add test case for Track.get_correction() + * Add test case for Artist.get_correction() + * Add suppport for track.getCorrection + * Add suppport for artist.getCorrection + * Fixed broken comment + * User.GetPersonalTags bug fix + * Added User.GetPersonalTags test cases + * Fixed broken comment + * Cleanup of User.GetPersonalTags stuff + * Support for User.GetPersonalTags + * Remove useless Scrutinizer badge + * Replace broken pypip.in badges with shields.io + +- changes from version 1.2.1: + * Remember to release on master + * Update release checklist + +------------------------------------------------------------------- +Sun Aug 16 16:57:29 UTC 2015 - zaitor@opensuse.org + +- Add missing python3-six Requires. + +------------------------------------------------------------------- Old: ---- pylast-1.2.1.tar.gz New: ---- pylast-1.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-pylast.spec ++++++ --- /var/tmp/diff_new_pack.Qadokz/_old 2015-09-30 05:52:24.000000000 +0200 +++ /var/tmp/diff_new_pack.Qadokz/_new 2015-09-30 05:52:24.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-pylast -Version: 1.2.1 +Version: 1.4.2 Release: 0 Summary: A python3 interface to Last.fm License: Apache-2.0 @@ -27,6 +27,7 @@ BuildRequires: fdupes BuildRequires: python3-devel BuildRequires: python3-setuptools +Requires: python3-six BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch ++++++ pylast-1.2.1.tar.gz -> pylast-1.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylast-1.2.1/PKG-INFO new/pylast-1.4.2/PKG-INFO --- old/pylast-1.2.1/PKG-INFO 2015-05-07 09:34:51.000000000 +0200 +++ new/pylast-1.4.2/PKG-INFO 2015-09-07 14:36:22.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pylast -Version: 1.2.1 +Version: 1.4.2 Summary: A Python interface to Last.fm and Libre.fm Home-page: https://github.com/pylast/pylast Author: Amr Hassan <amr.hassan@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylast-1.2.1/README.md new/pylast-1.4.2/README.md --- old/pylast-1.2.1/README.md 2015-05-07 09:09:02.000000000 +0200 +++ new/pylast-1.4.2/README.md 2015-09-07 13:56:28.000000000 +0200 @@ -1,7 +1,7 @@ pyLast ====== -[![Build Status](https://travis-ci.org/pylast/pylast.svg?branch=develop)](https://travis-ci.org/pylast/pylast) [![PyPI version](https://pypip.in/version/pylast/badge.svg)](https://pypi.python.org/pypi/pylast/) [![PyPI downloads](https://pypip.in/download/pylast/badge.svg)](https://pypi.python.org/pypi/pylast/) [![Coverage Status](https://coveralls.io/repos/pylast/pylast/badge.png?branch=develop)](https://coveralls.io/r/pylast/pylast?branch=develop) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pylast/pylast/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/pylast/pylast/?branch=develop) [![Code Health](https://landscape.io/github/pylast/pylast/develop/landscape.svg)](https://landscape.io/github/hugovk/pylast/develop) +[![Build Status](https://travis-ci.org/pylast/pylast.svg?branch=develop)](https://travis-ci.org/pylast/pylast) [![PyPI version](https://img.shields.io/pypi/v/pylast.svg)](https://pypi.python.org/pypi/pylast/) [![PyPI downloads](https://img.shields.io/pypi/dm/pylast.svg)](https://pypi.python.org/pypi/pylast/) [![Coverage Status](https://coveralls.io/repos/pylast/pylast/badge.png?branch=develop)](https://coveralls.io/r/pylast/pylast?branch=develop) [![Code Health](https://landscape.io/github/pylast/pylast/develop/landscape.svg)](https://landscape.io/github/hugovk/pylast/develop) A Python interface to [Last.fm](http://www.last.fm/) and other api-compatible websites such as [Libre.fm](http://libre.fm/). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylast-1.2.1/pylast/__init__.py new/pylast-1.4.2/pylast/__init__.py --- old/pylast-1.2.1/pylast/__init__.py 2015-05-07 09:18:45.000000000 +0200 +++ new/pylast-1.4.2/pylast/__init__.py 2015-09-07 14:07:10.000000000 +0200 @@ -21,7 +21,7 @@ # https://github.com/pylast/pylast import hashlib -from xml.dom import minidom +from xml.dom import minidom, Node import xml.dom import time import shelve @@ -32,7 +32,7 @@ import re import six -__version__ = '1.2.1' +__version__ = '1.4.2' __author__ = 'Amr Hassan, hugovk' __copyright__ = "Copyright (C) 2008-2010 Amr Hassan, 2013-2015 hugovk" __license__ = "apache2" @@ -1928,6 +1928,12 @@ return self.name + def get_correction(self): + """Returns the corrected artist name.""" + + return _extract( + self._request(self.ws_prefix + ".getCorrection"), "name") + def get_cover_image(self, size=COVER_MEGA): """ Returns a uri to the cover image @@ -2947,6 +2953,12 @@ def __init__(self, artist, title, network, username=None): super(Track, self).__init__(artist, title, network, "track", username) + def get_correction(self): + """Returns the corrected track name.""" + + return _extract( + self._request(self.ws_prefix + ".getCorrection"), "name") + def get_duration(self): """Returns the track duration.""" @@ -3505,6 +3517,41 @@ return doc.getElementsByTagName( "registered")[0].getAttribute("unixtime") + def get_tagged_albums(self, tag, limit=None, cacheable=True): + """Returns the albums tagged by a user.""" + + params = self._get_params() + params['tag'] = tag + params['taggingtype'] = 'album' + if limit: + params['limit'] = limit + doc = self._request(self.ws_prefix + '.getpersonaltags', cacheable, + params) + return _extract_albums(doc, self.network) + + def get_tagged_artists(self, tag, limit=None): + """Returns the artists tagged by a user.""" + + params = self._get_params() + params['tag'] = tag + params['taggingtype'] = 'artist' + if limit: + params["limit"] = limit + doc = self._request(self.ws_prefix + '.getpersonaltags', True, params) + return _extract_artists(doc, self.network) + + def get_tagged_tracks(self, tag, limit=None, cacheable=True): + """Returns the tracks tagged by a user.""" + + params = self._get_params() + params['tag'] = tag + params['taggingtype'] = 'track' + if limit: + params['limit'] = limit + doc = self._request(self.ws_prefix + '.getpersonaltags', cacheable, + params) + return _extract_tracks(doc, self.network) + def get_top_albums( self, period=PERIOD_OVERALL, limit=None, cacheable=True): """Returns the top albums played by a user. @@ -3693,7 +3740,7 @@ def get_recommended_artists(self, limit=50, cacheable=False): """ - Returns a sequence of Event objects + Returns a sequence of Artist objects if limit==None it will return all """ @@ -3967,6 +4014,16 @@ return casted +def cleanup_nodes(doc): + """ + Remove text nodes containing only whitespace + """ + for node in doc.documentElement.childNodes: + if node.nodeType == Node.TEXT_NODE and node.nodeValue.isspace(): + doc.documentElement.removeChild(node) + return doc + + def _collect_nodes(limit, sender, method_name, cacheable, params=None): """ Returns a sequence of dom.Node objects about as close to limit as possible @@ -3982,8 +4039,9 @@ while not end_of_pages and (not limit or (limit and len(nodes) < limit)): params["page"] = str(page) doc = sender._request(method_name, cacheable, params) + doc = cleanup_nodes(doc) - main = doc.documentElement.childNodes[1] + main = doc.documentElement.childNodes[0] if main.hasAttribute("totalPages"): total_pages = _number(main.getAttribute("totalPages")) @@ -4087,6 +4145,31 @@ return seq +def _extract_artists(doc, network): + seq = [] + for node in doc.getElementsByTagName("artist"): + seq.append(Artist(_extract(node, "name"), network)) + return seq + + +def _extract_albums(doc, network): + seq = [] + for node in doc.getElementsByTagName("album"): + name = _extract(node, "name") + artist = _extract(node, "name", 1) + seq.append(Album(artist, name, network)) + return seq + + +def _extract_tracks(doc, network): + seq = [] + for node in doc.getElementsByTagName("track"): + name = _extract(node, "name") + artist = _extract(node, "name", 1) + seq.append(Track(artist, name, network)) + return seq + + def _extract_events_from_doc(doc, network): events = [] for node in doc.getElementsByTagName("event"): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylast-1.2.1/pylast.egg-info/PKG-INFO new/pylast-1.4.2/pylast.egg-info/PKG-INFO --- old/pylast-1.2.1/pylast.egg-info/PKG-INFO 2015-05-07 09:34:51.000000000 +0200 +++ new/pylast-1.4.2/pylast.egg-info/PKG-INFO 2015-09-07 14:36:22.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pylast -Version: 1.2.1 +Version: 1.4.2 Summary: A Python interface to Last.fm and Libre.fm Home-page: https://github.com/pylast/pylast Author: Amr Hassan <amr.hassan@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylast-1.2.1/pylast.egg-info/pbr.json new/pylast-1.4.2/pylast.egg-info/pbr.json --- old/pylast-1.2.1/pylast.egg-info/pbr.json 2015-05-07 09:34:51.000000000 +0200 +++ new/pylast-1.4.2/pylast.egg-info/pbr.json 2015-09-07 14:36:22.000000000 +0200 @@ -1 +1 @@ -{"is_release": true, "git_version": "b47c5e5"} \ No newline at end of file +{"is_release": true, "git_version": "dc7528a"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylast-1.2.1/setup.py new/pylast-1.4.2/setup.py --- old/pylast-1.2.1/setup.py 2015-05-07 09:18:36.000000000 +0200 +++ new/pylast-1.4.2/setup.py 2015-09-07 14:07:19.000000000 +0200 @@ -4,7 +4,7 @@ setup( name="pylast", - version="1.2.1", + version="1.4.2", author="Amr Hassan <amr.hassan@gmail.com>", install_requires=['six'], tests_require=['mock', 'pytest', 'coverage', 'pep8', 'pyyaml', 'pyflakes'],
participants (1)
-
root@hilbert.suse.de