Hello community,

here is the log from the commit of package python-CairoSVG for openSUSE:Factory 
checked in at 2019-09-23 12:02:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-CairoSVG (Old)
 and      /work/SRC/openSUSE:Factory/.python-CairoSVG.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-CairoSVG"

Mon Sep 23 12:02:39 2019 rev:6 rq:729372 version:2.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-CairoSVG/python-CairoSVG.changes  
2019-06-07 12:18:05.616795656 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-CairoSVG.new.7948/python-CairoSVG.changes    
    2019-09-23 12:02:42.245951994 +0200
@@ -1,0 +2,8 @@
+Mon Sep  9 09:16:37 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 2.4.1:
+  * Fix the scale parameter
+  * Allow href attributes with no namespace
+  * Fix the tree root detection
+
+-------------------------------------------------------------------

Old:
----
  CairoSVG-2.4.0.tar.gz

New:
----
  CairoSVG-2.4.1.tar.gz

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

Other differences:
------------------
++++++ python-CairoSVG.spec ++++++
--- /var/tmp/diff_new_pack.QwvtxA/_old  2019-09-23 12:02:43.081951856 +0200
+++ /var/tmp/diff_new_pack.QwvtxA/_new  2019-09-23 12:02:43.097951854 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-CairoSVG
-Version:        2.4.0
+Version:        2.4.1
 Release:        0
 Summary:        A Python SVG converter based on Cairo
 License:        LGPL-3.0-or-later

++++++ CairoSVG-2.4.0.tar.gz -> CairoSVG-2.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/CairoSVG.egg-info/PKG-INFO 
new/CairoSVG-2.4.1/CairoSVG.egg-info/PKG-INFO
--- old/CairoSVG-2.4.0/CairoSVG.egg-info/PKG-INFO       2019-05-20 
13:44:43.000000000 +0200
+++ new/CairoSVG-2.4.1/CairoSVG.egg-info/PKG-INFO       2019-08-21 
12:10:32.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: CairoSVG
-Version: 2.4.0
+Version: 2.4.1
 Summary: A Simple SVG Converter based on Cairo
 Home-page: http://www.cairosvg.org/
 Author: Guillaume Ayoub
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/PKG-INFO new/CairoSVG-2.4.1/PKG-INFO
--- old/CairoSVG-2.4.0/PKG-INFO 2019-05-20 13:44:43.000000000 +0200
+++ new/CairoSVG-2.4.1/PKG-INFO 2019-08-21 12:10:32.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: CairoSVG
-Version: 2.4.0
+Version: 2.4.1
 Summary: A Simple SVG Converter based on Cairo
 Home-page: http://www.cairosvg.org/
 Author: Guillaume Ayoub
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/VERSION 
new/CairoSVG-2.4.1/cairosvg/VERSION
--- old/CairoSVG-2.4.0/cairosvg/VERSION 2019-05-20 13:19:01.000000000 +0200
+++ new/CairoSVG-2.4.1/cairosvg/VERSION 2019-08-21 12:03:38.000000000 +0200
@@ -1 +1 @@
-2.4.0
\ No newline at end of file
+2.4.1
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/bounding_box.py 
new/CairoSVG-2.4.1/cairosvg/bounding_box.py
--- old/CairoSVG-2.4.0/cairosvg/bounding_box.py 2019-02-15 13:46:16.000000000 
+0100
+++ new/CairoSVG-2.4.1/cairosvg/bounding_box.py 2019-05-31 10:44:56.000000000 
+0200
@@ -357,7 +357,7 @@
 
 def bounding_box_use(surface, node):
     """Get the bounding box of a ``use`` node."""
-    href = parse_url(node.get('{http://www.w3.org/1999/xlink}href')).geturl()
+    href = parse_url(node.get_href()).geturl()
     tree = Tree(
         url=href, url_fetcher=node.url_fetcher, parent=node,
         unsafe=node.unsafe)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/defs.py 
new/CairoSVG-2.4.1/cairosvg/defs.py
--- old/CairoSVG-2.4.0/cairosvg/defs.py 2019-05-18 17:22:44.000000000 +0200
+++ new/CairoSVG-2.4.1/cairosvg/defs.py 2019-05-31 10:45:07.000000000 +0200
@@ -49,8 +49,7 @@
 def update_def_href(surface, def_name, def_dict):
     """Update the attributes of the def according to its href attribute."""
     def_node = def_dict[def_name]
-    href = parse_url(
-        def_node.get('{http://www.w3.org/1999/xlink}href')).fragment
+    href = parse_url(def_node.get_href()).fragment
     if href in def_dict:
         update_def_href(surface, href, def_dict)
         href_node = def_dict[href]
@@ -359,7 +358,7 @@
         del node['viewBox']
     if 'mask' in node:
         del node['mask']
-    href = parse_url(node.get('{http://www.w3.org/1999/xlink}href')).geturl()
+    href = parse_url(node.get_href()).geturl()
     tree = Tree(
         url=href, url_fetcher=node.url_fetcher, parent=node,
         tree_cache=surface.tree_cache, unsafe=node.unsafe)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/helpers.py 
new/CairoSVG-2.4.1/cairosvg/helpers.py
--- old/CairoSVG-2.4.0/cairosvg/helpers.py      2019-05-20 12:06:59.000000000 
+0200
+++ new/CairoSVG-2.4.1/cairosvg/helpers.py      2019-05-29 17:28:08.000000000 
+0200
@@ -240,16 +240,7 @@
             if len(values) == 1:
                 values = 2 * values
             matrix.scale(*values)
-    apply_matrix_transform(surface, matrix, gradient)
 
-
-def apply_matrix_transform(surface, matrix, gradient=None):
-    """Apply a ``matrix`` to ``surface`` or ``gradient`` if supplied.
-
-    When the matrix is not invertible, this function clips the context to an
-    empty path instead of raising an exception.
-
-    """
     try:
         matrix.invert()
     except cairo.Error:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/image.py 
new/CairoSVG-2.4.1/cairosvg/image.py
--- old/CairoSVG-2.4.0/cairosvg/image.py        2019-05-18 19:30:56.000000000 
+0200
+++ new/CairoSVG-2.4.1/cairosvg/image.py        2019-05-31 10:45:18.000000000 
+0200
@@ -40,7 +40,7 @@
     base_url = node.get('{http://www.w3.org/XML/1998/namespace}base')
     if not base_url and node.url:
         base_url = os.path.dirname(node.url) + '/'
-    url = parse_url(node.get('{http://www.w3.org/1999/xlink}href'), base_url)
+    url = parse_url(node.get_href(), base_url)
     image_bytes = node.fetch_url(url, 'image/*')
 
     if len(image_bytes) < 5:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/parser.py 
new/CairoSVG-2.4.1/cairosvg/parser.py
--- old/CairoSVG-2.4.0/cairosvg/parser.py       2019-03-01 17:08:27.000000000 
+0100
+++ new/CairoSVG-2.4.1/cairosvg/parser.py       2019-05-31 12:22:38.000000000 
+0200
@@ -56,6 +56,7 @@
     'dx',
     'dy',
     '{http://www.w3.org/1999/xlink}href',
+    'href',
 ))
 
 COLOR_ATTRIBUTES = frozenset((
@@ -272,9 +273,10 @@
             trailing_space = self.text.endswith(' ')
         for child_element in element.iter_children():
             child = child_element.etree_element
-            if child.tag == '{http://www.w3.org/2000/svg}tref':
-                url = parse_url(child.get(
-                    '{http://www.w3.org/1999/xlink}href')).geturl()
+            if child.tag in ('{http://www.w3.org/2000/svg}tref', 'tref'):
+                href = child.get(
+                    '{http://www.w3.org/1999/xlink}href', child.get('href'))
+                url = parse_url(href).geturl()
                 child_tree = Tree(
                     url=url, url_fetcher=self.url_fetcher, parent=self,
                     unsafe=self.unsafe)
@@ -322,6 +324,9 @@
 
         return children, trailing_space
 
+    def get_href(self):
+        return self.get('{http://www.w3.org/1999/xlink}href', self.get('href'))
+
 
 class Tree(Node):
     """SVG tree."""
@@ -388,7 +393,7 @@
             (url and url.startswith('#') and not self.url))
         if self_is_parent:
             root_parent = parent
-            while root_parent.parent:
+            while root_parent.parent is not None:
                 root_parent = root_parent.parent
             tree = root_parent.xml_tree
         else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/surface.py 
new/CairoSVG-2.4.1/cairosvg/surface.py
--- old/CairoSVG-2.4.0/cairosvg/surface.py      2019-05-20 12:10:48.000000000 
+0200
+++ new/CairoSVG-2.4.1/cairosvg/surface.py      2019-05-29 17:27:14.000000000 
+0200
@@ -30,8 +30,8 @@
     filter_, gradient_or_pattern, linear_gradient, marker, mask, paint_mask,
     parse_all_defs, pattern, prepare_filter, radial_gradient, use)
 from .helpers import (
-    UNITS, PointError, apply_matrix_transform, clip_rect, node_format,
-    normalize, paint, preserve_ratio, size, transform)
+    UNITS, PointError, clip_rect, node_format, normalize, paint,
+    preserve_ratio, size, transform)
 from .image import image
 from .parser import Tree
 from .path import draw_markers, path
@@ -205,7 +205,7 @@
         self.context.scale(
             self.device_units_per_user_units, self.device_units_per_user_units)
         # Initial, non-rounded dimensions
-        self.set_context_size(width, height, viewbox, scale, tree)
+        self.set_context_size(width, height, viewbox, tree)
         self.context.move_to(0, 0)
         self.draw(tree)
 
@@ -229,7 +229,7 @@
         cairo_surface = self.surface_class(self.output, width, height)
         return cairo_surface, width, height
 
-    def set_context_size(self, width, height, viewbox, scale, tree):
+    def set_context_size(self, width, height, viewbox, tree):
         """Set the Cairo context size, set the SVG viewport size."""
         if viewbox:
             rect_x, rect_y = viewbox[0:2]
@@ -254,11 +254,6 @@
         self.context_width = rect_width / scale_x
         self.context_height = rect_height / scale_y
 
-        if scale != 1:
-            matrix = cairo.Matrix()
-            matrix.scale(scale, scale)
-            apply_matrix_transform(self, matrix)
-
     def finish(self):
         """Read the surface content."""
         self.cairo.finish()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/svg.py 
new/CairoSVG-2.4.1/cairosvg/svg.py
--- old/CairoSVG-2.4.0/cairosvg/svg.py  2019-05-18 19:30:56.000000000 +0200
+++ new/CairoSVG-2.4.1/cairosvg/svg.py  2019-05-29 17:24:40.000000000 +0200
@@ -26,4 +26,4 @@
     """Draw a svg ``node``."""
     if node.parent is not None:
         width, height, viewbox = node_format(surface, node)
-        surface.set_context_size(width, height, viewbox, 1, node)
+        surface.set_context_size(width, height, viewbox, node)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CairoSVG-2.4.0/cairosvg/text.py 
new/CairoSVG-2.4.1/cairosvg/text.py
--- old/CairoSVG-2.4.0/cairosvg/text.py 2019-02-15 13:46:16.000000000 +0100
+++ new/CairoSVG-2.4.1/cairosvg/text.py 2019-05-31 10:46:14.000000000 +0200
@@ -80,9 +80,7 @@
     ascent, descent, _, max_x_advance, max_y_advance = (
         surface.context.font_extents())
 
-    text_path_href = parse_url(
-        node.get('{http://www.w3.org/1999/xlink}href', '') or
-        node.parent.get('{http://www.w3.org/1999/xlink}href', ''))
+    text_path_href = parse_url(node.get_href() or node.parent.get_href() or '')
     if text_path_href.fragment:
         text_path = surface.paths.get(text_path_href.fragment)
     else:


Reply via email to