@@ -37,7 +37,7 @@ def update_def_href(surface, def_name, def_dict):
3737 update_def_href (surface , href , def_dict )
3838 href_node = def_dict [href ]
3939 def_dict [def_name ] = Tree (
40- url = '#{}' . format ( def_name ) , url_fetcher = def_node .url_fetcher ,
40+ url = f '#{ def_name } ' , url_fetcher = def_node .url_fetcher ,
4141 parent = href_node , parent_children = (not def_node .children ),
4242 tree_cache = surface .tree_cache , unsafe = def_node .unsafe )
4343 # Inherit attributes generally not inherited
@@ -64,7 +64,7 @@ def parse_def(surface, node):
6464 'marker' , 'gradient' , 'pattern' , 'path' , 'mask' , 'filter' ,
6565 'image' ):
6666 if def_type in node .tag .lower () and 'id' in node :
67- getattr (surface , '{ }s'. format ( def_type ) )[node ['id' ]] = node
67+ getattr (surface , f' { def_type } s' )[node ['id' ]] = node
6868
6969
7070def gradient_or_pattern (surface , node , name , opacity ):
@@ -139,9 +139,7 @@ def paint_mask(surface, node, name, opacity):
139139 if mask_node .get ('maskUnits' ) == 'userSpaceOnUse' :
140140 x = mask_node ['x' ]
141141 y = mask_node ['y' ]
142- mask_node ['viewBox' ] = '{} {} {} {}' .format (
143- mask_node ['x' ], mask_node ['y' ],
144- mask_node ['width' ], mask_node ['height' ])
142+ mask_node ['viewBox' ] = '{x} {y} {width} {height}' .format (** mask_node )
145143
146144 from .surface import SVGSurface # circular import
147145 mask_surface = SVGSurface (mask_node , None , surface .dpi , surface )
@@ -248,8 +246,7 @@ def draw_pattern(surface, node, name, opacity):
248246 pattern_node ['width' ] = pattern_width
249247 pattern_node ['height' ] = pattern_height
250248 if pattern_node .get ('patternContentUnits' ) == 'objectBoundingBox' :
251- pattern_node ['transform' ] = 'scale({}, {})' .format (
252- width , height )
249+ pattern_node ['transform' ] = f'scale({ width } , { height } )'
253250
254251 # Fail if pattern has an invalid size
255252 if pattern_width == 0.0 or pattern_height == 0.0 :
0 commit comments