@@ -50,7 +50,7 @@ def create_svg_object(with_doctype=False):
5050
5151
5252SIZE = "{0:.3f}mm"
53- COMMENT = "Autogenerated with python-barcode {}" . format ( version )
53+ COMMENT = f "Autogenerated with python-barcode { version } "
5454PATH = os .path .dirname (os .path .abspath (__file__ ))
5555
5656
@@ -322,7 +322,7 @@ def _init(self, code):
322322 attributes = {
323323 "width" : "100%" ,
324324 "height" : "100%" ,
325- "style" : "fill:{}" . format ( self .background ) ,
325+ "style" : f "fill:{ self .background } " ,
326326 }
327327 _set_attributes (background , ** attributes )
328328 self ._group .appendChild (background )
@@ -334,7 +334,7 @@ def _create_module(self, xpos, ypos, width, color):
334334 "y" : SIZE .format (ypos ),
335335 "width" : SIZE .format (width ),
336336 "height" : SIZE .format (self .module_height ),
337- "style" : "fill:{};" . format ( color ) ,
337+ "style" : f "fill:{ color } ;" ,
338338 }
339339 _set_attributes (element , ** attributes )
340340 self ._group .appendChild (element )
@@ -372,12 +372,12 @@ def _finish(self):
372372
373373 def save (self , filename , output ):
374374 if self .compress :
375- _filename = "{ }.svgz". format ( filename )
375+ _filename = f" { filename } .svgz"
376376 f = gzip .open (_filename , "wb" )
377377 f .write (output )
378378 f .close ()
379379 else :
380- _filename = "{ }.svg". format ( filename )
380+ _filename = f" { filename } .svg"
381381 with open (_filename , "wb" ) as f :
382382 f .write (output )
383383 return _filename
@@ -449,7 +449,7 @@ def _finish(self):
449449 return self ._image
450450
451451 def save (self , filename , output ):
452- filename = "{ }.{}" . format ( filename , self .format .lower ())
452+ filename = f" { filename } .{ self .format .lower ()} "
453453 output .save (filename , self .format .upper ())
454454 return filename
455455
0 commit comments