@@ -47,11 +47,11 @@ def create_svg_object(with_doctype=False):
4747
4848
4949SIZE = "{0:.3f}mm"
50- COMMENT = "Autogenerated with python-barcode {0 }" .format (version )
50+ COMMENT = "Autogenerated with python-barcode {}" .format (version )
5151PATH = os .path .dirname (os .path .abspath (__file__ ))
5252
5353
54- class BaseWriter ( object ) :
54+ class BaseWriter :
5555 """Baseclass for all writers.
5656
5757 Initializes the basic writer options. Childclasses can add more
@@ -259,7 +259,7 @@ def _init(self, code):
259259 attributes = {
260260 "width" : "100%" ,
261261 "height" : "100%" ,
262- "style" : "fill:{0 }" .format (self .background ),
262+ "style" : "fill:{}" .format (self .background ),
263263 }
264264 _set_attributes (background , ** attributes )
265265 self ._group .appendChild (background )
@@ -271,7 +271,7 @@ def _create_module(self, xpos, ypos, width, color):
271271 "y" : SIZE .format (ypos ),
272272 "width" : SIZE .format (width ),
273273 "height" : SIZE .format (self .module_height ),
274- "style" : "fill:{0 };" .format (color ),
274+ "style" : "fill:{};" .format (color ),
275275 }
276276 _set_attributes (element , ** attributes )
277277 self ._group .appendChild (element )
@@ -288,7 +288,7 @@ def _create_text(self, xpos, ypos):
288288 attributes = {
289289 "x" : SIZE .format (xpos ),
290290 "y" : SIZE .format (ypos ),
291- "style" : "fill:{0 };font-size:{1 }pt;text-anchor:middle;" .format (
291+ "style" : "fill:{};font-size:{}pt;text-anchor:middle;" .format (
292292 self .foreground , self .font_size ,
293293 ),
294294 }
@@ -308,12 +308,12 @@ def _finish(self):
308308
309309 def save (self , filename , output ):
310310 if self .compress :
311- _filename = "{0 }.svgz" .format (filename )
311+ _filename = "{}.svgz" .format (filename )
312312 f = gzip .open (_filename , "wb" )
313313 f .write (output )
314314 f .close ()
315315 else :
316- _filename = "{0 }.svg" .format (filename )
316+ _filename = "{}.svg" .format (filename )
317317 with open (_filename , "wb" ) as f :
318318 f .write (output )
319319 return _filename
@@ -364,6 +364,6 @@ def _finish(self):
364364 return self ._image
365365
366366 def save (self , filename , output ):
367- filename = "{0 }.{1 }" .format (filename , self .format .lower ())
367+ filename = "{}.{}" .format (filename , self .format .lower ())
368368 output .save (filename , self .format .upper ())
369369 return filename
0 commit comments