Hello community,

here is the log from the commit of package python3-polib for openSUSE:Factory 
checked in at 2017-02-22 13:54:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-polib (Old)
 and      /work/SRC/openSUSE:Factory/.python3-polib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-polib"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-polib/python3-polib-doc.changes  
2016-06-19 10:48:51.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3-polib.new/python3-polib-doc.changes     
2017-02-22 13:54:28.332311311 +0100
@@ -1,0 +2,15 @@
+Mon Feb 20 20:12:52 UTC 2017 - a...@gmx.de
+
+- specfile:
+  * update copyright year
+
+- update to version 1.0.8:
+  * Fixed issue #70 (occurrences parsing for windows pathes)
+  * Fixed issue #71 (tcomment and flags not saved for obsolete
+    entries)
+  * Fixed issue #72 (wrong metadata ordering)
+  * Fixed issue #73 (can’t always unpickle POFile)
+  * Use natural sorting for additional headers (metadata)
+  * Fixed typos in various documents
+
+-------------------------------------------------------------------
python3-polib.changes: same change

Old:
----
  polib-1.0.7.tar.gz

New:
----
  polib-1.0.8.tar.gz

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

Other differences:
------------------
++++++ python3-polib-doc.spec ++++++
--- /var/tmp/diff_new_pack.B0XpUQ/_old  2017-02-22 13:54:29.116199774 +0100
+++ /var/tmp/diff_new_pack.B0XpUQ/_new  2017-02-22 13:54:29.120199205 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-polib-doc
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           python3-polib-doc
-Version:        1.0.7
+Version:        1.0.8
 Release:        0
 Summary:        Documentation for Library to Manipulate gettext Files
 License:        MIT

python3-polib.spec: same change
++++++ polib-1.0.7.tar.gz -> polib-1.0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/CHANGELOG new/polib-1.0.8/CHANGELOG
--- old/polib-1.0.7/CHANGELOG   2015-07-08 08:21:36.000000000 +0200
+++ new/polib-1.0.8/CHANGELOG   2016-11-21 14:30:52.000000000 +0100
@@ -2,6 +2,15 @@
 Changelog
 =========
 
+Version 1.0.8 (2016/11/21)
+--------------------------
+ - Fixed issue #70 (occurrences parsing for windows pathes)
+ - Fixed issue #71 (tcomment and flags not saved for obsolete entries)
+ - Fixed issue #72 (wrong metadata ordering)
+ - Fixed issue #73 (can't always unpickle POFile)
+ - Use natural sorting for additional headers (metadata)
+ - Fixed typos in various documents
+
 Version 1.0.7 (2015/07/08)
 --------------------------
  - Fixed bad parsing of indented msgstr_plural
@@ -145,7 +154,7 @@
  - fixed issue #0015: no LICENSE file included in tarball,  
  - removed Version/Date from README,
  - added test pot files to MANIFEST.in,
- - performance improvment in find() method (thanks Thomas !).
+ - performance improvement in find() method (thanks Thomas !).
 
 Version 0.4.1 (2009/03/04)
 --------------------------
@@ -159,7 +168,7 @@
 Version 0.4.0 (2008/11/26)
 --------------------------
  - fixed bug #0005: percent_translated divide by 0 on empty po files,
- - fixed bug #0004: occurrences that have hiphens are wrapped when they should 
not,
+ - fixed bug #0004: occurrences that have hyphens are wrapped when they should 
not,
  - changes in how encoding is handled,
  - remove deprecation warnings for typo on "occurrences",
  - added POEntry.__cmp__() method to sort entries like gettext does,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/PKG-INFO new/polib-1.0.8/PKG-INFO
--- old/polib-1.0.7/PKG-INFO    2015-07-08 08:23:06.000000000 +0200
+++ new/polib-1.0.8/PKG-INFO    2016-11-21 14:32:21.000000000 +0100
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: polib
-Version: 1.0.7
+Version: 1.0.8
 Summary: A library to manipulate gettext files (po and mo files).
 Home-page: http://bitbucket.org/izi/polib/
 Author: David Jean Louis
 Author-email: izimo...@gmail.com
 License: MIT
-Download-URL: 
https://pypi.python.org/packages/source/p/polib/polib-1.0.7.tar.gz
+Download-URL: 
https://pypi.python.org/packages/source/p/polib/polib-1.0.8.tar.gz
 Description: 
         =====
         polib
@@ -52,6 +52,15 @@
         Changelog
         =========
         
+        Version 1.0.8 (2016/11/21)
+        --------------------------
+         - Fixed issue #70 (occurrences parsing for windows pathes)
+         - Fixed issue #71 (tcomment and flags not saved for obsolete entries)
+         - Fixed issue #72 (wrong metadata ordering)
+         - Fixed issue #73 (can't always unpickle POFile)
+         - Use natural sorting for additional headers (metadata)
+         - Fixed typos in various documents
+        
         Version 1.0.7 (2015/07/08)
         --------------------------
          - Fixed bad parsing of indented msgstr_plural
@@ -195,7 +204,7 @@
          - fixed issue #0015: no LICENSE file included in tarball,  
          - removed Version/Date from README,
          - added test pot files to MANIFEST.in,
-         - performance improvment in find() method (thanks Thomas !).
+         - performance improvement in find() method (thanks Thomas !).
         
         Version 0.4.1 (2009/03/04)
         --------------------------
@@ -209,7 +218,7 @@
         Version 0.4.0 (2008/11/26)
         --------------------------
          - fixed bug #0005: percent_translated divide by 0 on empty po files,
-         - fixed bug #0004: occurrences that have hiphens are wrapped when 
they should not,
+         - fixed bug #0004: occurrences that have hyphens are wrapped when 
they should not,
          - changes in how encoding is handled,
          - remove deprecation warnings for typo on "occurrences",
          - added POEntry.__cmp__() method to sort entries like gettext does,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/__init__.py new/polib-1.0.8/__init__.py
--- old/polib-1.0.7/__init__.py 2014-12-05 10:19:35.000000000 +0100
+++ new/polib-1.0.8/__init__.py 2016-05-19 11:20:52.000000000 +0200
@@ -2,4 +2,4 @@
 # version of polib as a mercurial sub-repository for example.
 #
 # This file will NOT be installed when installing polib with pip, setuptools,
-# or any other mecanism based on the setup.py file.
+# or any other mechanism based on the setup.py file.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/docs/projects.rst 
new/polib-1.0.8/docs/projects.rst
--- old/polib-1.0.7/docs/projects.rst   2014-12-05 10:19:35.000000000 +0100
+++ new/polib-1.0.8/docs/projects.rst   2016-05-19 11:20:52.000000000 +0200
@@ -11,7 +11,6 @@
 * `Django-rosetta <http://code.google.com/p/django-rosetta/>`_
 * `The evergreen library system <http://www.open-ils.org/>`_
 * `Qooxdoo <http://qooxdoo.org/>`_
-* `<http://www.linux.rk.edu.pl/tra/list/>`_
 * `Lictionary <http://www.lictionary.in/>`_
 * `Jasy - Web Tooling Framework <https://github.com/sebastian-software/jasy>`_
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/polib.egg-info/PKG-INFO 
new/polib-1.0.8/polib.egg-info/PKG-INFO
--- old/polib-1.0.7/polib.egg-info/PKG-INFO     2015-07-08 08:23:06.000000000 
+0200
+++ new/polib-1.0.8/polib.egg-info/PKG-INFO     2016-11-21 14:32:21.000000000 
+0100
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: polib
-Version: 1.0.7
+Version: 1.0.8
 Summary: A library to manipulate gettext files (po and mo files).
 Home-page: http://bitbucket.org/izi/polib/
 Author: David Jean Louis
 Author-email: izimo...@gmail.com
 License: MIT
-Download-URL: 
https://pypi.python.org/packages/source/p/polib/polib-1.0.7.tar.gz
+Download-URL: 
https://pypi.python.org/packages/source/p/polib/polib-1.0.8.tar.gz
 Description: 
         =====
         polib
@@ -52,6 +52,15 @@
         Changelog
         =========
         
+        Version 1.0.8 (2016/11/21)
+        --------------------------
+         - Fixed issue #70 (occurrences parsing for windows pathes)
+         - Fixed issue #71 (tcomment and flags not saved for obsolete entries)
+         - Fixed issue #72 (wrong metadata ordering)
+         - Fixed issue #73 (can't always unpickle POFile)
+         - Use natural sorting for additional headers (metadata)
+         - Fixed typos in various documents
+        
         Version 1.0.7 (2015/07/08)
         --------------------------
          - Fixed bad parsing of indented msgstr_plural
@@ -195,7 +204,7 @@
          - fixed issue #0015: no LICENSE file included in tarball,  
          - removed Version/Date from README,
          - added test pot files to MANIFEST.in,
-         - performance improvment in find() method (thanks Thomas !).
+         - performance improvement in find() method (thanks Thomas !).
         
         Version 0.4.1 (2009/03/04)
         --------------------------
@@ -209,7 +218,7 @@
         Version 0.4.0 (2008/11/26)
         --------------------------
          - fixed bug #0005: percent_translated divide by 0 on empty po files,
-         - fixed bug #0004: occurrences that have hiphens are wrapped when 
they should not,
+         - fixed bug #0004: occurrences that have hyphens are wrapped when 
they should not,
          - changes in how encoding is handled,
          - remove deprecation warnings for typo on "occurrences",
          - added POEntry.__cmp__() method to sort entries like gettext does,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/polib.py new/polib-1.0.8/polib.py
--- old/polib-1.0.7/polib.py    2015-07-08 08:14:47.000000000 +0200
+++ new/polib-1.0.8/polib.py    2016-11-21 14:27:20.000000000 +0100
@@ -13,7 +13,7 @@
 """
 
 __author__ = 'David Jean Louis <izimo...@gmail.com>'
-__version__ = '1.0.7'
+__version__ = '1.0.8'
 __all__ = ['pofile', 'POFile', 'POEntry', 'mofile', 'MOFile', 'MOEntry',
            'default_encoding', 'escape', 'unescape', 'detect_encoding', ]
 
@@ -262,13 +262,25 @@
         return m  # handles escaped double quote
     return re.sub(r'\\(\\|n|t|r|")', unescape_repl, st)
 # }}}
+# function natural_sort() {{{
+
+
+def natural_sort(lst):
+    """
+    Sort naturally the given list.
+    Credits: http://stackoverflow.com/a/4836734
+    """
+    convert = lambda text: int(text) if text.isdigit() else text.lower() 
+    alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) 
] 
+    return sorted(lst, key = alphanum_key)
+# }}}
 # class _BaseFile {{{
 
 
 class _BaseFile(list):
     """
     Common base class for the :class:`~polib.POFile` and :class:`~polib.MOFile`
-    classes. This class should **not** be instanciated directly.
+    classes. This class should **not** be instantiated directly.
     """
 
     def __init__(self, *args, **kwargs):
@@ -367,7 +379,9 @@
         ``entry``
             an instance of :class:`~polib._BaseEntry`.
         """
-        if self.check_for_duplicates and entry in self:
+        # check_for_duplicates may not be defined (yet) when unpickling.
+        # But if pickling, we never want to check for duplicates anyway.
+        if getattr(self, 'check_for_duplicates', False) and entry in self:
             raise ValueError('Entry "%s" already exists' % entry.msgid)
         super(_BaseFile, self).append(entry)
 
@@ -483,10 +497,10 @@
             'PO-Revision-Date',
             'Last-Translator',
             'Language-Team',
+            'Language',
             'MIME-Version',
             'Content-Type',
             'Content-Transfer-Encoding',
-            'Language',
             'Plural-Forms'
         ]
         ordered_data = []
@@ -498,7 +512,7 @@
                 pass
         # the rest of the metadata will be alphabetically ordered since there
         # are no specs for this AFAIK
-        for data in sorted(metadata.keys()):
+        for data in natural_sort(metadata.keys()):
             value = metadata[data]
             ordered_data.append((data, value))
         return ordered_data
@@ -780,7 +794,7 @@
 class _BaseEntry(object):
     """
     Base class for :class:`~polib.POEntry` and :class:`~polib.MOEntry` classes.
-    This class should **not** be instanciated directly.
+    This class should **not** be instantiated directly.
     """
 
     def __init__(self, *args, **kwargs):
@@ -953,12 +967,12 @@
         """
         Returns the unicode representation of the entry.
         """
-        if self.obsolete:
-            return _BaseEntry.__unicode__(self, wrapwidth)
-
         ret = []
         # comments first, if any (with text wrapping as xgettext does)
-        comments = [('comment', '#. '), ('tcomment', '# ')]
+        if self.obsolete:
+            comments = [('tcomment', '# ')]
+        else:
+            comments = [('comment', '#. '), ('tcomment', '# ')]
         for c in comments:
             val = getattr(self, c[0])
             if val:
@@ -975,7 +989,7 @@
                         ret.append('%s%s' % (c[1], comment))
 
         # occurrences (with text wrapping as xgettext does)
-        if self.occurrences:
+        if not self.obsolete and self.occurrences:
             filelist = []
             for fpath, lineno in self.occurrences:
                 if lineno:
@@ -1005,17 +1019,17 @@
         # previous context and previous msgid/msgid_plural
         fields = ['previous_msgctxt', 'previous_msgid',
                   'previous_msgid_plural']
+        if self.obsolete:
+            prefix = "#~| "
+        else:
+            prefix = "#| "
         for f in fields:
             val = getattr(self, f)
             if val:
-                ret += self._str_field(f, "#| ", "", val, wrapwidth)
+                ret += self._str_field(f, prefix, "", val, wrapwidth)
 
         ret.append(_BaseEntry.__unicode__(self, wrapwidth))
         ret = u('\n').join(ret)
-
-        assert isinstance(ret, text_type)
-        #if type(ret) != types.UnicodeType:
-        #    return unicode(ret, self.encoding)
         return ret
 
     def __cmp__(self, other):
@@ -1490,7 +1504,7 @@
         for occurrence in occurrences:
             if occurrence != '':
                 try:
-                    fil, line = occurrence.split(':')
+                    fil, line = occurrence.rsplit(':', 1)
                     if not line.isdigit():
                         fil = fil + line
                         line = ''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/tests/test_fuzzy_header.po 
new/polib-1.0.8/tests/test_fuzzy_header.po
--- old/polib-1.0.7/tests/test_fuzzy_header.po  2014-12-05 10:19:35.000000000 
+0100
+++ new/polib-1.0.8/tests/test_fuzzy_header.po  2016-11-21 13:07:50.000000000 
+0100
@@ -12,3 +12,6 @@
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-SearchPath-1: Foo\n"
+"X-Poedit-SearchPath-2: Bar\n"
+"X-Poedit-SearchPath-10: Baz\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/tests/test_weird_occurrences.po 
new/polib-1.0.8/tests/test_weird_occurrences.po
--- old/polib-1.0.7/tests/test_weird_occurrences.po     2014-12-05 
10:19:35.000000000 +0100
+++ new/polib-1.0.8/tests/test_weird_occurrences.po     2016-11-21 
13:55:52.000000000 +0100
@@ -14,6 +14,12 @@
 "X-Etoys-Domain: etoys\n"
 "X-Etoys-SystemVersion: etoys3.0 of 24 February 2008 update 2029\n"
 
+
+# Windows paths
+#: C:\foo\bar.py:12
+msgid "Windows path"
+msgstr "Windows path"
+
 #. Test for empty comment lines
 #. 
 #,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/polib-1.0.7/tests/tests.py 
new/polib-1.0.8/tests/tests.py
--- old/polib-1.0.7/tests/tests.py      2015-07-07 14:27:59.000000000 +0200
+++ new/polib-1.0.8/tests/tests.py      2016-11-21 13:04:46.000000000 +0100
@@ -88,7 +88,7 @@
         Test that weird occurrences are correctly parsed.
         """
         po = polib.pofile('tests/test_weird_occurrences.po')
-        self.assertEqual(len(po), 46)
+        self.assertEqual(len(po), 47)
 
     def test_pofile_and_mofile9(self):
         """
@@ -209,7 +209,7 @@
     
     def test_detect_encoding1(self):
         """
-        Test that given enconding is returned when file has no encoding 
defined.
+        Test that given encoding is returned when file has no encoding defined.
         """
         self.assertEqual(polib.detect_encoding('tests/test_noencoding.po'), 
'utf-8')
 
@@ -314,6 +314,10 @@
         po = polib.pofile('tests/test_utf8.po')
         self.assertEqual(po[-1].linenum, 3478)
 
+    def test_windows_path_occurrences(self):
+        po = polib.pofile('tests/test_weird_occurrences.po')
+        self.assertEqual(po[0].occurrences, [('C:\\foo\\bar.py', '12')])
+
 
 class TestBaseFile(unittest.TestCase):
     """
@@ -414,7 +418,10 @@
             ('Language-Team', u('LANGUAGE <l...@li.org>')),
             ('MIME-Version', u('1.0')),
             ('Content-Type', u('text/plain; charset=UTF-8')),
-            ('Content-Transfer-Encoding', u('8bit'))
+            ('Content-Transfer-Encoding', u('8bit')),
+            ('X-Poedit-SearchPath-1', u('Foo')),
+            ('X-Poedit-SearchPath-2', u('Bar')),
+            ('X-Poedit-SearchPath-10', u('Baz')),
         ]
         self.assertEqual(pofile.ordered_metadata(), mdata)
 


Reply via email to