Hello community,

here is the log from the commit of package python3-logilab-common for 
openSUSE:Factory checked in at 2016-05-30 09:58:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-logilab-common (Old)
 and      /work/SRC/openSUSE:Factory/.python3-logilab-common.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-logilab-common"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python3-logilab-common/python3-logilab-common.changes
    2016-05-25 21:24:44.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.python3-logilab-common.new/python3-logilab-common.changes
       2016-05-30 09:58:50.000000000 +0200
@@ -1,0 +2,14 @@
+Sun May 29 04:24:46 UTC 2016 - a...@gmx.de
+
+- update to version 1.2.1:
+  * [test] noop instead of skip test_utcdatetime for mxDateTime
+  * [pkg] add egenix-mx-base in test requirements
+  * [pkg] add a requirements-test.txt
+  * [pep8] changelog.py
+  * [pep8] test/unittest_changelog
+  * [changelog] ensure ChangeLogEntry write unicode (closes #6213577)
+  * [registry] Stop using load_module_from_name
+  * Fix regression with datetime2ticks vs date object as argument
+  * [spec] Only require python-egenix-mx-base on EL6
+
+-------------------------------------------------------------------
@@ -6 +19,0 @@
-

Old:
----
  logilab-common-1.2.0.tar.gz

New:
----
  logilab-common-1.2.1.tar.gz

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

Other differences:
------------------
++++++ python3-logilab-common.spec ++++++
--- /var/tmp/diff_new_pack.hvQaRW/_old  2016-05-30 09:58:51.000000000 +0200
+++ /var/tmp/diff_new_pack.hvQaRW/_new  2016-05-30 09:58:51.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python3-logilab-common
-Version:        1.2.0
+Version:        1.2.1
 Release:        0
 Url:            http://www.logilab.org/projects/common/
 Summary:        Python lowlevel functionality shared by logilab projects

++++++ logilab-common-1.2.0.tar.gz -> logilab-common-1.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/PKG-INFO 
new/logilab-common-1.2.1/PKG-INFO
--- old/logilab-common-1.2.0/PKG-INFO   2016-03-15 10:38:06.000000000 +0100
+++ new/logilab-common-1.2.1/PKG-INFO   2016-05-27 15:27:30.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: logilab-common
-Version: 1.2.0
+Version: 1.2.1
 Summary: collection of low-level Python packages and modules used by Logilab 
projects
 Home-page: http://www.logilab.org/project/logilab-common
 Author: Logilab
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/__pkginfo__.py 
new/logilab-common-1.2.1/__pkginfo__.py
--- old/logilab-common-1.2.0/__pkginfo__.py     2016-03-15 10:24:29.000000000 
+0100
+++ new/logilab-common-1.2.1/__pkginfo__.py     2016-05-27 15:12:20.000000000 
+0200
@@ -25,7 +25,7 @@
 subpackage_of = 'logilab'
 subpackage_master = True
 
-numversion = (1, 2, 0)
+numversion = (1, 2, 1)
 version = '.'.join([str(num) for num in numversion])
 
 license = 'LGPL' # 2.1 or later
@@ -41,10 +41,13 @@
 include_dirs = [join('test', 'data')]
 
 install_requires = [
-        'setuptools',
-        'six >= 1.4.0',
-        ]
-tests_require = ['pytz']
+    'setuptools',
+    'six >= 1.4.0',
+]
+tests_require = [
+    'pytz',
+    'egenix-mx-base',
+]
 
 if sys.version_info < (2, 7):
     install_requires.append('unittest2 >= 0.5.1')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/logilab/common/changelog.py 
new/logilab-common-1.2.1/logilab/common/changelog.py
--- old/logilab-common-1.2.0/logilab/common/changelog.py        2016-03-15 
10:24:29.000000000 +0100
+++ new/logilab-common-1.2.1/logilab/common/changelog.py        2016-05-27 
15:12:20.000000000 +0200
@@ -3,18 +3,18 @@
 #
 # This file is part of logilab-common.
 #
-# logilab-common is free software: you can redistribute it and/or modify it 
under
+# logilab-common is free software: you can redistribute it or modify it under
 # the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation, either version 2.1 of the License, or (at your option) 
any
-# later version.
+# Software Foundation, either version 2.1 of the License, or (at your option)
+# any later version.
 #
 # logilab-common 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 logilab-common.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with logilab-common.  If not, see <http://www.gnu.org/licenses/>.
 """Manipulation of upstream change log files.
 
 The upstream change log files format handled is simpler than the one
@@ -48,6 +48,7 @@
 
 import sys
 from stat import S_IWRITE
+import codecs
 
 from six import string_types
 
@@ -55,19 +56,22 @@
 SUBBULLET = '-'
 INDENT = ' ' * 4
 
+
 class NoEntry(Exception):
     """raised when we are unable to find an entry"""
 
+
 class EntryNotFound(Exception):
     """raised when we are unable to find a given entry"""
 
+
 class Version(tuple):
     """simple class to handle soft version number has a tuple while
     correctly printing it as X.Y.Z
     """
     def __new__(cls, versionstr):
         if isinstance(versionstr, string_types):
-            versionstr = versionstr.strip(' :') # XXX (syt) duh?
+            versionstr = versionstr.strip(' :')  # XXX (syt) duh?
             parsed = cls.parse(versionstr)
         else:
             parsed = versionstr
@@ -79,11 +83,13 @@
         try:
             return [int(i) for i in versionstr.split('.')]
         except ValueError as ex:
-            raise ValueError("invalid literal for version '%s' 
(%s)"%(versionstr, ex))
+            raise ValueError("invalid literal for version '%s' (%s)" %
+                             (versionstr, ex))
 
     def __str__(self):
         return '.'.join([str(i) for i in self])
 
+
 # upstream change log #########################################################
 
 class ChangeLogEntry(object):
@@ -109,44 +115,50 @@
         """complete the latest added message
         """
         if not self.messages:
-            raise ValueError('unable to complete last message as there is no 
previous message)')
-        if self.messages[-1][1]: # sub messages
+            raise ValueError('unable to complete last message as '
+                             'there is no previous message)')
+        if self.messages[-1][1]:  # sub messages
             self.messages[-1][1][-1].append(msg_suite)
-        else: # message
+        else:  # message
             self.messages[-1][0].append(msg_suite)
 
     def add_sub_message(self, sub_msg, key=None):
         if not self.messages:
-            raise ValueError('unable to complete last message as there is no 
previous message)')
+            raise ValueError('unable to complete last message as '
+                             'there is no previous message)')
         if key is None:
             self.messages[-1][1].append([sub_msg])
         else:
-            raise NotImplementedError("sub message to specific key are not 
implemented yet")
+            raise NotImplementedError('sub message to specific key '
+                                      'are not implemented yet')
 
     def write(self, stream=sys.stdout):
         """write the entry to file """
-        stream.write('%s  --  %s\n' % (self.date or '', self.version or ''))
+        stream.write(u'%s  --  %s\n' % (self.date or '', self.version or ''))
         for msg, sub_msgs in self.messages:
-            stream.write('%s%s %s\n' % (INDENT, BULLET, msg[0]))
-            stream.write(''.join(msg[1:]))
+            stream.write(u'%s%s %s\n' % (INDENT, BULLET, msg[0]))
+            stream.write(u''.join(msg[1:]))
             if sub_msgs:
-                stream.write('\n')
+                stream.write(u'\n')
             for sub_msg in sub_msgs:
-                stream.write('%s%s %s\n' % (INDENT * 2, SUBBULLET, sub_msg[0]))
-                stream.write(''.join(sub_msg[1:]))
-            stream.write('\n')
+                stream.write(u'%s%s %s\n' %
+                             (INDENT * 2, SUBBULLET, sub_msg[0]))
+                stream.write(u''.join(sub_msg[1:]))
+            stream.write(u'\n')
+
+        stream.write(u'\n\n')
 
-        stream.write('\n\n')
 
 class ChangeLog(object):
     """object representation of a whole ChangeLog file"""
 
     entry_class = ChangeLogEntry
 
-    def __init__(self, changelog_file, title=''):
+    def __init__(self, changelog_file, title=u''):
         self.file = changelog_file
+        assert isinstance(title, type(u'')), 'title must be a unicode object'
         self.title = title
-        self.additional_content = ''
+        self.additional_content = u''
         self.entries = []
         self.load()
 
@@ -184,12 +196,12 @@
     def load(self):
         """ read a logilab's ChangeLog from file """
         try:
-            stream = open(self.file)
+            stream = codecs.open(self.file, encoding='utf-8')
         except IOError:
             return
         last = None
         expect_sub = False
-        for line in stream.readlines():
+        for line in stream:
             sline = line.strip()
             words = sline.split()
             # if new entry
@@ -221,18 +233,17 @@
         stream.close()
 
     def format_title(self):
-        return '%s\n\n' % self.title.strip()
+        return u'%s\n\n' % self.title.strip()
 
     def save(self):
         """write back change log"""
         # filetutils isn't importable in appengine, so import locally
         from logilab.common.fileutils import ensure_fs_mode
         ensure_fs_mode(self.file, S_IWRITE)
-        self.write(open(self.file, 'w'))
+        self.write(codecs.open(self.file, 'w', encoding='utf-8'))
 
     def write(self, stream=sys.stdout):
         """write changelog to stream"""
         stream.write(self.format_title())
         for entry in self.entries:
             entry.write(stream)
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/logilab/common/date.py 
new/logilab-common-1.2.1/logilab/common/date.py
--- old/logilab-common-1.2.0/logilab/common/date.py     2016-03-15 
10:24:29.000000000 +0100
+++ new/logilab-common-1.2.1/logilab/common/date.py     2016-05-27 
15:12:20.000000000 +0200
@@ -237,7 +237,7 @@
     return datetime(somedate.year, somedate.month, somedate.day)
 
 def datetime2ticks(somedate):
-    return timegm(somedate.timetuple()) * 1000 + int(somedate.microsecond / 
1000)
+    return timegm(somedate.timetuple()) * 1000 + int(getattr(somedate, 
'microsecond', 0) / 1000)
 
 def ticks2datetime(ticks):
     miliseconds, microseconds = divmod(ticks, 1000)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/logilab/common/registry.py 
new/logilab-common-1.2.1/logilab/common/registry.py
--- old/logilab-common-1.2.0/logilab/common/registry.py 2016-03-15 
10:24:29.000000000 +0100
+++ new/logilab-common-1.2.1/logilab/common/registry.py 2016-05-27 
15:12:20.000000000 +0200
@@ -720,7 +720,6 @@
 
     def load_file(self, filepath, modname):
         """ load registrable objects (if any) from a python file """
-        from logilab.common.modutils import load_module_from_name
         if modname in self._loadedmods:
             return
         self._loadedmods[modname] = {}
@@ -735,7 +734,7 @@
         # module
         self._lastmodifs[filepath] = mdate
         # load the module
-        module = load_module_from_name(modname)
+        module = __import__(modname, fromlist=modname.split('.')[:-1])
         self.load_module(module)
 
     def load_module(self, module):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/logilab-common-1.2.0/logilab_common.egg-info/PKG-INFO 
new/logilab-common-1.2.1/logilab_common.egg-info/PKG-INFO
--- old/logilab-common-1.2.0/logilab_common.egg-info/PKG-INFO   2016-03-15 
10:37:37.000000000 +0100
+++ new/logilab-common-1.2.1/logilab_common.egg-info/PKG-INFO   2016-05-27 
15:27:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: logilab-common
-Version: 1.2.0
+Version: 1.2.1
 Summary: collection of low-level Python packages and modules used by Logilab 
projects
 Home-page: http://www.logilab.org/project/logilab-common
 Author: Logilab
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/test/unittest_changelog.py 
new/logilab-common-1.2.1/test/unittest_changelog.py
--- old/logilab-common-1.2.0/test/unittest_changelog.py 2016-03-15 
10:24:29.000000000 +0100
+++ new/logilab-common-1.2.1/test/unittest_changelog.py 2016-05-27 
15:12:20.000000000 +0200
@@ -1,28 +1,29 @@
-# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:cont...@logilab.fr
 #
 # This file is part of logilab-common.
 #
-# logilab-common is free software: you can redistribute it and/or modify it 
under
+# logilab-common is free software: you can redistribute it or modify it under
 # the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation, either version 2.1 of the License, or (at your option) 
any
-# later version.
+# Software Foundation, either version 2.1 of the License, or (at your option)
+# any later version.
 #
 # logilab-common 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 logilab-common.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with logilab-common.  If not, see <http://www.gnu.org/licenses/>.
 
 from os.path import join, dirname
 
-from logilab.common.compat import StringIO
+from io import StringIO
 from logilab.common.testlib import TestCase, unittest_main
 
 from logilab.common.changelog import ChangeLog
 
+
 class ChangeLogTC(TestCase):
     cl_class = ChangeLog
     cl_file = join(dirname(__file__), 'data', 'ChangeLog')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/logilab-common-1.2.0/test/unittest_date.py 
new/logilab-common-1.2.1/test/unittest_date.py
--- old/logilab-common-1.2.0/test/unittest_date.py      2016-03-15 
10:24:29.000000000 +0100
+++ new/logilab-common-1.2.1/test/unittest_date.py      2016-05-27 
15:12:20.000000000 +0200
@@ -149,7 +149,7 @@
 
     def test_utcdatetime(self):
         if self.datetimecls is mxDateTime:
-            raise self.skipTest('standard datetime only test')
+            return
         d = self.datetimecls(2014, 11, 26, 12, 0, 0, 57, tzinfo=pytz.utc)
         d = utcdatetime(d)
         self.assertEqual(d, self.datetimecls(2014, 11, 26, 12, 0, 0, 57))
@@ -174,6 +174,11 @@
         d = d.replace(microsecond=123456)
         self.assertEqual(datetime2ticks(d), timestamp * 1000 + 123)
 
+    def test_datetime2ticks_date_argument(self):
+        d = date(2014, 11, 26)
+        timestamp = timegm(d.timetuple())
+        self.assertEqual(datetime2ticks(d), timestamp * 1000)
+
 
 class MxDateTC(DateTC):
     datecls = mxDate


Reply via email to