Hello community,

here is the log from the commit of package python-discid for openSUSE:Factory 
checked in at 2016-08-03 11:42:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-discid (Old)
 and      /work/SRC/openSUSE:Factory/.python-discid.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-discid"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-discid/python-discid.changes      
2016-07-24 19:52:04.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-discid.new/python-discid.changes 
2016-08-03 11:42:54.000000000 +0200
@@ -1,0 +2,5 @@
+Sun Jul 24 00:10:11 UTC 2016 - [email protected]
+
+- Update to current upstream release 1.1.0
+
+-------------------------------------------------------------------

Old:
----
  discid-1.0.2.tar.gz

New:
----
  discid-1.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-discid.spec ++++++
--- /var/tmp/diff_new_pack.D4g9WH/_old  2016-08-03 11:42:55.000000000 +0200
+++ /var/tmp/diff_new_pack.D4g9WH/_new  2016-08-03 11:42:55.000000000 +0200
@@ -21,13 +21,13 @@
 %define modname discid
 
 Name:           python-%{modname}
-Version:        1.0.2
+Version:        1.1.0
 Release:        0
 Summary:        Python binding of Libdiscid
 License:        LGPL-3.0+
 Group:          Development/Libraries/Python
 Url:            https://python-discid.readthedocs.org/
-Source:         
http://pypi.python.org/packages/source/d/%{modname}/%{modname}-%{version}.tar.gz
+Source:         
https://pypi.python.org/packages/source/d/%{modname}/%{modname}-%{version}.tar.gz
 # no automatic requires since libdiscid is not linked
 Requires:       libdiscid0 >= 0.2.2
 BuildRequires:  libdiscid0 >= 0.2.2

++++++ discid-1.0.2.tar.gz -> discid-1.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/CHANGES.rst new/discid-1.1.0/CHANGES.rst
--- old/discid-1.0.2/CHANGES.rst        2013-06-27 16:38:20.000000000 +0200
+++ new/discid-1.1.0/CHANGES.rst        2013-10-09 22:19:51.000000000 +0200
@@ -1,6 +1,15 @@
 Changelog
 =========
 
+Changes in 1.1.0 (2013-10-09):
+------------------------------
+ * feature :issue:`36` add :attr:`Disc.toc_string`
+ * :issue:`38` remove :class:`DiscId` (deprecated since 0.5.0)
+
+Changes in 1.0.3 (2013-10-06):
+------------------------------
+ * fix: :issue:`37` test_emptyness: Assertion disc->success failed
+
 Changes in 1.0.2 (2013-06-27):
 ------------------------------
  * revert code to version 1.0.0 (see :issue:`35`)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/PKG-INFO new/discid-1.1.0/PKG-INFO
--- old/discid-1.0.2/PKG-INFO   2013-06-27 16:45:08.000000000 +0200
+++ new/discid-1.1.0/PKG-INFO   2013-10-09 22:23:50.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: discid
-Version: 1.0.2
+Version: 1.1.0
 Summary: Python binding of Libdiscid
 Home-page: https://python-discid.readthedocs.org/
 Author: Johannes Dewender
@@ -67,5 +67,8 @@
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.1
+Classifier: Programming Language :: Python :: 3.2
+Classifier: Programming Language :: Python :: 3.3
 Classifier: Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/discid/__init__.py 
new/discid-1.1.0/discid/__init__.py
--- old/discid-1.0.2/discid/__init__.py 2013-06-27 16:38:29.000000000 +0200
+++ new/discid-1.1.0/discid/__init__.py 2013-10-09 22:19:29.000000000 +0200
@@ -30,11 +30,10 @@
 from discid.disc import read, put, Disc, DiscError, TOCError
 from discid.track import Track
 from discid.libdiscid import get_default_device
-from discid.deprecated import DiscId
 import discid.libdiscid
 import discid.disc
 
-__version__ = "1.0.2"
+__version__ = "1.1.0"
 
 
 # these contants are defined here so sphinx can catch the "docstrings"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/discid/deprecated.py 
new/discid-1.1.0/discid/deprecated.py
--- old/discid-1.0.2/discid/deprecated.py       2013-06-27 15:51:06.000000000 
+0200
+++ new/discid-1.1.0/discid/deprecated.py       1970-01-01 01:00:00.000000000 
+0100
@@ -1,37 +0,0 @@
-# Copyright (C) 2013  Johannes Dewender
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-# Please submit bug reports to GitHub:
-# https://github.com/JonnyJD/python-discid/issues
-"""Deprecated functions and classes
-"""
-
-from warnings import warn, simplefilter
-
-from discid.disc import Disc
-
-# turn on DeprecationWarnings for DiscId below
-simplefilter(action="once", category=DeprecationWarning)
-
-
-class DiscId(Disc):
-    """Deprecated class, use :func:`read` or :func:`put` or :class:`Disc`.
-    """
-
-    def __init__(self):
-        warn("The DiscId class is deprecated.\n"
-             "Use read/put on module level or Disc:",
-             DeprecationWarning, stacklevel=2)
-        Disc.__init__(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/discid/deprecated_const.py 
new/discid-1.1.0/discid/deprecated_const.py
--- old/discid-1.0.2/discid/deprecated_const.py 2013-06-27 01:16:28.000000000 
+0200
+++ new/discid-1.1.0/discid/deprecated_const.py 1970-01-01 01:00:00.000000000 
+0100
@@ -1,2 +0,0 @@
-
-DUMMY = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/discid/deprecated_constants.py 
new/discid-1.1.0/discid/deprecated_constants.py
--- old/discid-1.0.2/discid/deprecated_constants.py     2013-06-27 
01:19:31.000000000 +0200
+++ new/discid-1.1.0/discid/deprecated_constants.py     1970-01-01 
01:00:00.000000000 +0100
@@ -1,41 +0,0 @@
-# Copyright (C) 2013  Johannes Dewender
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-# Please submit bug reports to GitHub:
-# https://github.com/JonnyJD/python-discid/issues
-"""Deprecated functions and classes
-"""
-
-import sys
-import types
-import warnings
-from warnings import warn_explicit, warn
-
-from discid.libdiscid import get_default_device
-
-
-#class _Constants(types.ModuleType):
-class _Constants(object):
-    def get_default_device(self):
-        #warnings.warn("DEFAULT_DEVICE is deprecated.\n"
-        #     "Use get_default_device() instead",
-        #     DeprecationWarning)
-        return get_default_device()
-        #return "blub"
-    DEFAULT_DEVICE = property(get_default_device)
-
-#print(sys.modules[__name__])
-sys.modules[__name__] = _Constants()
-sys.modules["discid.deprecated_const"] = _Constants()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/discid/disc.py 
new/discid-1.1.0/discid/disc.py
--- old/discid-1.0.2/discid/disc.py     2013-06-25 04:06:32.000000000 +0200
+++ new/discid-1.1.0/discid/disc.py     2013-10-07 23:49:53.000000000 +0200
@@ -18,6 +18,7 @@
 """Disc class
 """
 
+import re
 from ctypes import c_int, c_void_p, c_char_p, c_uint
 
 from discid.libdiscid import _LIB, FEATURES
@@ -104,10 +105,8 @@
         assert self._handle.value is not None
 
     def __str__(self):
-        if self._success:
-            return self.id
-        else:
-            return ""
+        assert self._success
+        return self.id
 
     _LIB.discid_get_error_msg.argtypes = (c_void_p, )
     _LIB.discid_get_error_msg.restype = c_char_p
@@ -183,22 +182,18 @@
     def _get_id(self):
         """Gets the current MusicBrainz disc ID
         """
-        if self._success:
-            result = _LIB.discid_get_id(self._handle)
-            return _decode(result)
-        else:
-            return None
+        assert self._success
+        result = _LIB.discid_get_id(self._handle)
+        return _decode(result)
 
     _LIB.discid_get_freedb_id.argtypes = (c_void_p, )
     _LIB.discid_get_freedb_id.restype = c_char_p
     def _get_freedb_id(self):
         """Gets the current FreeDB disc ID
         """
-        if self._success:
-            result = _LIB.discid_get_freedb_id(self._handle)
-            return _decode(result)
-        else:
-            return None
+        assert self._success
+        result = _LIB.discid_get_freedb_id(self._handle)
+        return _decode(result)
 
     _LIB.discid_get_submission_url.argtypes = (c_void_p, )
     _LIB.discid_get_submission_url.restype = c_char_p
@@ -206,17 +201,33 @@
         """Give an URL to submit the current TOC
         as a new Disc ID to MusicBrainz.
         """
-        if self._success:
-            result = _LIB.discid_get_submission_url(self._handle)
-            return _decode(result)
-        else:
+        assert self._success
+        result = _LIB.discid_get_submission_url(self._handle)
+        return _decode(result)
+
+    try:
+        _LIB.discid_get_toc_string.argtypes = (c_void_p, )
+        _LIB.discid_get_toc_string.restype = c_char_p
+    except AttributeError:
+        pass
+    def _get_toc_string(self):
+        """The TOC suitable as value of the `toc parameter`
+        when accessing the MusicBrainz Web Service.
+        """
+        assert self._success
+        try:
+            result = _LIB.discid_get_toc_string(self._handle)
+        except AttributeError:
             return None
+        else:
+            return _decode(result)
 
     _LIB.discid_get_first_track_num.argtypes = (c_void_p, )
     _LIB.discid_get_first_track_num.restype = c_int
     def _get_first_track_num(self):
         """Gets the first track number
         """
+        assert self._success
         return _LIB.discid_get_first_track_num(self._handle)
 
     _LIB.discid_get_last_track_num.argtypes = (c_void_p, )
@@ -224,6 +235,7 @@
     def _get_last_track_num(self):
         """Gets the last track number
         """
+        assert self._success
         return _LIB.discid_get_last_track_num(self._handle)
 
     _LIB.discid_get_sectors.argtypes = (c_void_p, )
@@ -231,6 +243,7 @@
     def _get_sectors(self):
         """Gets the total number of sectors on the disc
         """
+        assert self._success
         return _LIB.discid_get_sectors(self._handle)
 
     try:
@@ -241,7 +254,8 @@
     def _get_mcn(self):
         """Gets the current Media Catalogue Number (MCN/UPC/EAN)
         """
-        if self._success and "mcn" in self._requested_features:
+        assert self._success
+        if "mcn" in self._requested_features:
             try:
                 result = _LIB.discid_get_mcn(self._handle)
             except AttributeError:
@@ -284,6 +298,30 @@
             return url
 
     @property
+    def toc_string(self):
+        """The TOC suitable as value of the `toc parameter`
+        when accessing the MusicBrainz Web Service.
+
+        This is a :obj:`unicode` or :obj:`str <python:str>` object
+        and enables fuzzy searching when the actual Disc ID is not found.
+
+        Note that this is the unencoded value, which still contains spaces.
+
+        .. seealso:: `MusicBrainz Web Service 
<http://musicbrainz.org/doc/Development/XML_Web_Service/Version_2#discid>`_
+        """
+        toc_string = self._get_toc_string()
+        if toc_string is None and self.submission_url:
+            # probably an old version of libdiscid (< 0.6.0)
+            # gather toc string from submission_url
+            match = re.search("toc=([0-9+]+)", self.submission_url)
+            if match is None:
+                raise ValueError("can't get toc string from submission url")
+            else:
+                return match.group(1).replace("+", " ")
+        else:
+            return toc_string
+
+    @property
     def first_track_num(self):
         """Number of the first track"""
         return self._get_first_track_num()
@@ -304,7 +342,10 @@
     @property
     def seconds(self):
         """Total length in seconds"""
-        return _sectors_to_seconds(self.sectors)
+        if self.sectors is None:
+            return None
+        else:
+            return _sectors_to_seconds(self.sectors)
 
     @property
     def mcn(self):
@@ -321,9 +362,9 @@
         """A list of :class:`Track` objects for this Disc.
         """
         tracks = []
-        if self._success:
-            for number in range(self.first_track_num, self.last_track_num + 1):
-                tracks.append(Track(self, number))
+        assert self._success
+        for number in range(self.first_track_num, self.last_track_num + 1):
+            tracks.append(Track(self, number))
         return tracks
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/discid/track.py 
new/discid-1.1.0/discid/track.py
--- old/discid-1.0.2/discid/track.py    2013-06-21 02:43:20.000000000 +0200
+++ new/discid-1.1.0/discid/track.py    2013-10-07 23:45:57.000000000 +0200
@@ -34,19 +34,19 @@
         assert self._disc._handle.value is not None
 
     def __str__(self):
-        if self._disc._success:
-            return str(self.number)
-        else:
-            return ""
+        assert self._disc._success
+        return str(self.number)
 
     _LIB.discid_get_track_offset.argtypes = (c_void_p, c_int)
     _LIB.discid_get_track_offset.restype = c_int
     def _get_track_offset(self):
+        assert self._disc._success
         return _LIB.discid_get_track_offset(self._disc._handle, self.number)
 
     _LIB.discid_get_track_length.argtypes = (c_void_p, c_int)
     _LIB.discid_get_track_length.restype = c_int
     def _get_track_length(self):
+        assert self._disc._success
         return _LIB.discid_get_track_length(self._disc._handle, self.number)
 
     try:
@@ -55,7 +55,8 @@
     except AttributeError:
         pass
     def _get_track_isrc(self):
-        if self._disc._success and "isrc" in self._disc._requested_features:
+        assert self._disc._success
+        if "isrc" in self._disc._requested_features:
             try:
                 result = _LIB.discid_get_track_isrc(self._disc._handle,
                                                     self.number)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/doc/api.rst new/discid-1.1.0/doc/api.rst
--- old/discid-1.0.2/doc/api.rst        2013-06-27 16:16:26.000000000 +0200
+++ new/discid-1.1.0/doc/api.rst        2013-10-07 23:47:48.000000000 +0200
@@ -33,6 +33,7 @@
    .. autoattribute:: id
    .. autoattribute:: freedb_id
    .. autoattribute:: submission_url
+   .. autoattribute:: toc_string
    .. autoattribute:: first_track_num
    .. autoattribute:: last_track_num
    .. autoattribute:: sectors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/doc/install.rst 
new/discid-1.1.0/doc/install.rst
--- old/discid-1.0.2/doc/install.rst    2013-04-25 19:28:27.000000000 +0200
+++ new/discid-1.1.0/doc/install.rst    2013-09-12 17:11:27.000000000 +0200
@@ -29,8 +29,10 @@
    `SuSE Python 3 <http://software.opensuse.org/package/python3-discid>`_
    )
  * Ubuntu:
-   `PPA <https://launchpad.net/~jonnyjd/+archive/python-discid>`_
-   ( both )
+   PPA (
+   `musicbrainz-stable 
<https://launchpad.net/~musicbrainz-developers/+archive/stable>`_
+   and `musicbrainz-daily 
<https://launchpad.net/~musicbrainz-developers/+archive/daily>`_
+   )
 
 Your package manager will also handle the *libdiscid* dependency automatically.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/setup.py new/discid-1.1.0/setup.py
--- old/discid-1.0.2/setup.py   2013-06-25 18:47:54.000000000 +0200
+++ new/discid-1.1.0/setup.py   2013-10-07 23:45:57.000000000 +0200
@@ -31,7 +31,7 @@
                 self.names = []
         else:
             self.names = ["test_discid.TestModulePrivate",
-                          "test_discid.TestModule", "test_discid.TestClass"]
+                          "test_discid.TestModule"]
 
     def run(self):
         suite = unittest.defaultTestLoader.loadTestsFromNames(self.names)
@@ -61,6 +61,9 @@
             "Programming Language :: Python :: 2.6",
             "Programming Language :: Python :: 2.7",
             "Programming Language :: Python :: 3",
+            "Programming Language :: Python :: 3.1",
+            "Programming Language :: Python :: 3.2",
+            "Programming Language :: Python :: 3.3",
             "Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
             "Topic :: Software Development :: Libraries :: Python Modules"
             ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/discid-1.0.2/test_discid.py 
new/discid-1.1.0/test_discid.py
--- old/discid-1.0.2/test_discid.py     2013-06-25 03:33:02.000000000 +0200
+++ new/discid-1.1.0/test_discid.py     2013-10-07 23:48:32.000000000 +0200
@@ -100,29 +100,9 @@
             self.assertEqual(track.seconds,
                              math.floor((track.sectors / 75.0) + 0.5))
             self.assertEqual(type(track.seconds), int)
-
-
-class TestClass(unittest.TestCase):
-
-    def setUp(self):
-        self.disc = discid.Disc()
-        self.assertTrue(self.disc, "No Disc object created")
-
-    def test_emptyness(self):
-        # all should be empty and don't give exceptions
-        self.assertTrue(self.disc.id is None)
-        self.assertTrue(self.disc.freedb_id is None)
-        self.assertTrue(self.disc.submission_url is None)
-        self.assertTrue(self.disc.mcn is None)
-        self.assertFalse(self.disc.first_track_num)
-        self.assertFalse(self.disc.last_track_num)
-        self.assertFalse(self.disc.sectors)
-        self.assertFalse(self.disc.length)
-        self.assertFalse(self.disc.seconds)
-        self.assertFalse(self.disc.tracks)
-
-    def tearDown(self):
-        self.disc._free()
+        toc_string = ["1", disc.last_track_num, disc.sectors] + track_offsets
+        toc_string = " ".join(map(str, toc_string))
+        self.assertEqual(disc.toc_string, toc_string)
 
 
 class TestDisc(unittest.TestCase):
@@ -144,6 +124,7 @@
         self.assertEqual(len(disc.id), 28, "Invalid Disc ID")
         self.assertEqual(len(disc.freedb_id), 8, "Invalid FreeDB Disc ID")
         self.assertTrue(disc.submission_url, "Invalid submission url")
+        self.assertTrue(disc.toc_string, "Invalid toc string")
         self.assertEqual(disc.last_track_num, len(disc.tracks),
                         "Wrong amount of tracks")
         self.assertEqual(disc.sectors,
@@ -165,6 +146,7 @@
         disc_id = disc.id
         freedb_id = disc.freedb_id
         submission_url = disc.submission_url
+        toc_string = disc.toc_string
         first = disc.first_track_num
         last = disc.last_track_num
         sectors = disc.sectors
@@ -177,6 +159,8 @@
                          "different freedb id after put")
         self.assertEqual(disc.submission_url, submission_url,
                          "different submission_url after put")
+        self.assertEqual(disc.toc_string, toc_string,
+                         "different toc_string after put")
         self.assertEqual(disc.first_track_num, first,
                          "different first track after put")
         self.assertEqual(disc.last_track_num, last,
@@ -194,6 +178,7 @@
         disc = discid.read(features=["mcn", "isrc"]) # read from default drive
         self.assertEqual(len(disc.id), 28, "Invalid Disc ID")
         self.assertTrue(disc.submission_url, "Invalid submission url")
+        self.assertTrue(disc.toc_string, "Invalid toc string")
 
         if "mcn" in discid.FEATURES:
             self.assertTrue(disc.mcn is not None)


Reply via email to