Hello community,

here is the log from the commit of package python-relatorio for 
openSUSE:Factory checked in at 2020-01-29 13:15:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-relatorio (Old)
 and      /work/SRC/openSUSE:Factory/.python-relatorio.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-relatorio"

Wed Jan 29 13:15:42 2020 rev:9 rq:767950 version:0.9.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-relatorio/python-relatorio.changes        
2019-07-31 14:36:57.817847138 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-relatorio.new.26092/python-relatorio.changes 
    2020-01-29 13:16:18.342106191 +0100
@@ -1,0 +2,8 @@
+Tue Jan 28 08:57:49 UTC 2020 - Axel Braun <[email protected]>
+
+- Version 0.9.1
+  * Do not guess type of cell if directive is not alone
+  * Add support for Python 3.8
+  * Support file-magic as fallback to python-magic
+
+-------------------------------------------------------------------

Old:
----
  relatorio-0.9.0.tar.gz

New:
----
  relatorio-0.9.1.tar.gz

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

Other differences:
------------------
++++++ python-relatorio.spec ++++++
--- /var/tmp/diff_new_pack.Th35Md/_old  2020-01-29 13:16:24.690109437 +0100
+++ /var/tmp/diff_new_pack.Th35Md/_new  2020-01-29 13:16:24.738109462 +0100
@@ -2,7 +2,7 @@
 # spec file for package python-relatorio
 #
 # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
-# Copyright (c) 2016-2019 Dr. Axel Braun
+# Copyright (c) 2016-2020 Dr. Axel Braun
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         mod_name relatorio
 Name:           python-relatorio
-Version:        0.9.0
+Version:        0.9.1
 Release:        0
 Summary:        Python module to create reports from Python objects
 License:        GPL-3.0-or-later

++++++ relatorio-0.9.0.tar.gz -> relatorio-0.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/.drone.yml 
new/relatorio-0.9.1/.drone.yml
--- old/relatorio-0.9.0/.drone.yml      2019-07-29 15:52:57.000000000 +0200
+++ new/relatorio-0.9.1/.drone.yml      2019-12-26 10:42:44.000000000 +0100
@@ -1,6 +1,10 @@
 clone:
     hg:
         image: plugins/hg
+        environment:
+            - HG_SHARE_POOL=/root/.cache/hg
+        volumes:
+            - cache:/root/.cache
 
 pipeline:
     tox:
@@ -23,3 +27,5 @@
           TOXENV: py36
         - IMAGE: python:3.7
           TOXENV: py37
+        - IMAGE: python:3.8
+          TOXENV: py38
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/.hgtags new/relatorio-0.9.1/.hgtags
--- old/relatorio-0.9.0/.hgtags 2019-07-29 16:01:09.000000000 +0200
+++ new/relatorio-0.9.1/.hgtags 2020-01-26 11:01:39.000000000 +0100
@@ -26,3 +26,4 @@
 0775b131b51d40c2147b1ae104f760698a8d9f9e 0.8.0
 a9a586fec08da03f86ec781472a981949d4c455a 0.8.1
 a0cf6c5a86e3eaf125a96f942f64114b326dba3b 0.9.0
+34f63c525603ed1fe903703725a51d28cdfa622f 0.9.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/CHANGES new/relatorio-0.9.1/CHANGES
--- old/relatorio-0.9.0/CHANGES 2019-07-29 15:55:56.000000000 +0200
+++ new/relatorio-0.9.1/CHANGES 2020-01-26 10:59:46.000000000 +0100
@@ -1,3 +1,8 @@
+0.9.1 - 20200126
+* Do not guess type of cell if directive is not alone
+* Add support for Python 3.8
+* Support file-magic as fallback to python-magic
+
 0.9.0 - 20190729
 * Support out parameter of render
 * Write opendocument stream directly to the ZipFile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/PKG-INFO new/relatorio-0.9.1/PKG-INFO
--- old/relatorio-0.9.0/PKG-INFO        2019-07-29 16:02:35.000000000 +0200
+++ new/relatorio-0.9.1/PKG-INFO        2020-01-26 11:02:15.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: relatorio
-Version: 0.9.0
+Version: 0.9.1
 Summary: A templating library able to output odt and pdf files
 Home-page: http://relatorio.tryton.org/
 Author: Nicolas Evrard
@@ -32,5 +32,5 @@
 Classifier: Programming Language :: Python :: 3
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Classifier: Topic :: Text Processing
-Provides-Extra: fodt
 Provides-Extra: chart
+Provides-Extra: fodt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/doc/conf.py 
new/relatorio-0.9.1/doc/conf.py
--- old/relatorio-0.9.0/doc/conf.py     2019-07-29 15:57:29.000000000 +0200
+++ new/relatorio-0.9.1/doc/conf.py     2019-07-29 16:12:17.000000000 +0200
@@ -50,7 +50,7 @@
 # The short X.Y version.
 version = '0.9'
 # The full version, including alpha/beta/rc tags.
-release = '0.9.0'
+release = '0.9.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/relatorio/__init__.py 
new/relatorio-0.9.1/relatorio/__init__.py
--- old/relatorio-0.9.0/relatorio/__init__.py   2019-07-29 15:56:20.000000000 
+0200
+++ new/relatorio-0.9.1/relatorio/__init__.py   2019-07-29 16:12:24.000000000 
+0200
@@ -12,5 +12,5 @@
 from .reporting import MIMETemplateLoader, ReportRepository, Report
 from . import templates
 
-__version__ = '0.9.0'
+__version__ = '0.9.1'
 __all__ = ['MIMETemplateLoader', 'ReportRepository', 'Report', 'templates']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/relatorio/templates/opendocument.py 
new/relatorio-0.9.1/relatorio/templates/opendocument.py
--- old/relatorio-0.9.0/relatorio/templates/opendocument.py     2019-07-29 
16:00:49.000000000 +0200
+++ new/relatorio-0.9.1/relatorio/templates/opendocument.py     2020-01-24 
22:03:47.000000000 +0100
@@ -538,9 +538,13 @@
                 grand_parent = parent.getparent()
                 # Guess type only if it is the only value in the cell
                 # and its parent has no style
-                if (grand_parent is None
-                        or grand_parent.tag != table_cell_tag
-                        ) or len(grand_parent) != 1 or has_style(parent):
+                if ((grand_parent is None
+                            or grand_parent.tag != table_cell_tag)
+                        or len(grand_parent) != 1
+                        or len(parent) != 1
+                        or (parent.text and parent.text.strip())
+                        or (r_node.tail and r_node.tail.strip())
+                        or has_style(parent)):
                     r_node.attrib[py_replace] = (
                         '__relatorio_escape_invalid_chars(%s)' % expr)
                     continue
@@ -950,7 +954,11 @@
         binary_data, = image.xpath(
             './office:binary-data', namespaces=namespaces)
         data = base64.b64decode(binary_data.text)
-        mime_type = magic.from_buffer(data, mime=True)
+        if hasattr(magic, 'from_buffer'):
+            mime_type = magic.from_buffer(data, mime=True)
+        else:
+            # Not python-magic but file-magic
+            mime_type = magic.detect_from_content(data).mime_type
         name = 'Pictures/image%s%s' % (
             i, mimetypes.guess_extension(mime_type))
         image.remove(binary_data)
@@ -1071,7 +1079,7 @@
             self._zinfo = None
 
         def open(self, zinfo):
-            if self._fp:
+            if self._fp or self._buffer:
                 self.close()
             self._zinfo = zinfo
             self._fp = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/relatorio/tests/test_odt.py 
new/relatorio-0.9.1/relatorio/tests/test_odt.py
--- old/relatorio-0.9.0/relatorio/tests/test_odt.py     2019-07-29 
16:00:49.000000000 +0200
+++ new/relatorio-0.9.1/relatorio/tests/test_odt.py     2019-12-26 
10:42:44.000000000 +0100
@@ -104,6 +104,92 @@
             child.get('{http://genshi.edgewall.org/}replace'),
             '__relatorio_escape_invalid_chars(foo)')
 
+    @unittest.skipIf(
+        not hasattr(unittest.TestCase, 'assertRegex'),
+        'assertRegex not supported')
+    def test_directives_in_cell(self):
+        "Testing the guess type of directive inside cell"
+        xml = b'''<xml xmlns:text="urn:text" xmlns:table="urn:table" 
xmlns:xlink="urn:xlink">
+                    <table:table-cell>
+                        <text:p>
+                            <text:a xlink:href="relatorio://foo">foo</text:a>
+                        </text:p>
+                    </table:table-cell>
+                 </xml>'''
+        interpolated = self.oot.insert_directives(xml)
+        root_interpolated = lxml.etree.parse(interpolated).getroot()
+        cell = root_interpolated[0]
+        self.assertRegex(
+            cell.get('{http://genshi.edgewall.org/}attrs'),
+            '__relatorio_guess_type\(__relatorio_store_cache\([0-9]*, foo\)\)')
+        child = cell[0][0]
+        self.assertRegex(
+            child.get('{http://genshi.edgewall.org/}replace'),
+            '__relatorio_get_cache\([0-9]*\)')
+
+    def test_directives_in_cell_with_children(self):
+        "Testing directive inside cell with children"
+        xml = b'''<xml xmlns:text="urn:text" xmlns:table="urn:table" 
xmlns:xlink="urn:xlink">
+                    <table:table-cell>
+                        <text:p>
+                            <text:a xlink:href="relatorio://foo">foo</text:a>
+                        </text:p>
+                        <text:p>bar</text:p>
+                    </table:table-cell>
+                 </xml>'''
+        interpolated = self.oot.insert_directives(xml)
+        root_interpolated = lxml.etree.parse(interpolated).getroot()
+        cell = root_interpolated[0]
+        self.assertEqual(len(cell), 2)
+        self.assertFalse(
+            cell.get('{http://genshi.edgewall.org/}attrs'))
+        child = cell[0][0]
+        self.assertEqual(
+            child.get('{http://genshi.edgewall.org/}replace'),
+            '__relatorio_escape_invalid_chars(foo)')
+
+    def test_directives_in_cell_with_text(self):
+        "Testing directive inside cell with text"
+        xml = b'''<xml xmlns:text="urn:text" xmlns:table="urn:table" 
xmlns:xlink="urn:xlink">
+                    <table:table-cell>
+                        <text:p>
+                            bar
+                            <text:a xlink:href="relatorio://foo">foo</text:a>
+                        </text:p>
+                    </table:table-cell>
+                 </xml>'''
+        interpolated = self.oot.insert_directives(xml)
+        root_interpolated = lxml.etree.parse(interpolated).getroot()
+        cell = root_interpolated[0]
+        self.assertEqual(len(cell), 1)
+        self.assertFalse(
+            cell.get('{http://genshi.edgewall.org/}attrs'))
+        child = cell[0][0]
+        self.assertEqual(
+            child.get('{http://genshi.edgewall.org/}replace'),
+            '__relatorio_escape_invalid_chars(foo)')
+
+    def test_directives_in_cell_with_tail(self):
+        "Testing directive inside cell with text"
+        xml = b'''<xml xmlns:text="urn:text" xmlns:table="urn:table" 
xmlns:xlink="urn:xlink">
+                    <table:table-cell>
+                        <text:p>
+                            <text:a xlink:href="relatorio://foo">foo</text:a>
+                            bar
+                        </text:p>
+                    </table:table-cell>
+                 </xml>'''
+        interpolated = self.oot.insert_directives(xml)
+        root_interpolated = lxml.etree.parse(interpolated).getroot()
+        cell = root_interpolated[0]
+        self.assertEqual(len(cell), 1)
+        self.assertFalse(
+            cell.get('{http://genshi.edgewall.org/}attrs'))
+        child = cell[0][0]
+        self.assertEqual(
+            child.get('{http://genshi.edgewall.org/}replace'),
+            '__relatorio_escape_invalid_chars(foo)')
+
     def test_column_looping(self):
         xml = b'''
 <table:table
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/relatorio.egg-info/PKG-INFO 
new/relatorio-0.9.1/relatorio.egg-info/PKG-INFO
--- old/relatorio-0.9.0/relatorio.egg-info/PKG-INFO     2019-07-29 
16:02:34.000000000 +0200
+++ new/relatorio-0.9.1/relatorio.egg-info/PKG-INFO     2020-01-26 
11:02:14.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: relatorio
-Version: 0.9.0
+Version: 0.9.1
 Summary: A templating library able to output odt and pdf files
 Home-page: http://relatorio.tryton.org/
 Author: Nicolas Evrard
@@ -32,5 +32,5 @@
 Classifier: Programming Language :: Python :: 3
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Classifier: Topic :: Text Processing
-Provides-Extra: fodt
 Provides-Extra: chart
+Provides-Extra: fodt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/relatorio-0.9.0/tox.ini new/relatorio-0.9.1/tox.ini
--- old/relatorio-0.9.0/tox.ini 2018-08-18 13:27:26.000000000 +0200
+++ new/relatorio-0.9.1/tox.ini 2019-12-26 10:42:44.000000000 +0100
@@ -4,7 +4,7 @@
 # and then run "tox" from this directory.
 
 [tox]
-envlist = py26, py27, py32, py33, py34, py35, py36, py37, pypy
+envlist = py26, py27, py32, py33, py34, py35, py36, py37, py38, pypy
 
 [testenv]
 commands = {envpython} setup.py test


Reply via email to