Skip to content

Commit

Permalink
SVG Image: Forward keyword arguments
Browse files Browse the repository at this point in the history
Pass on the keyword arguments in to_string() and new_image().
  • Loading branch information
agnat committed Jan 9, 2022
1 parent 6527e8e commit 5b9fc76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qrcode/image/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def save(self, stream, kind=None):
self.check_kind(kind=kind)
self._write(stream)

def to_string(self):
return ET.tostring(self._img)
def to_string(self, **kwargs):
return ET.tostring(self._img, **kwargs)

def new_image(self, **kwargs):
return self._svg()
return self._svg(**kwargs)

def _svg(self, tag=None, version='1.1', **kwargs):
if tag is None:
Expand Down Expand Up @@ -142,10 +142,10 @@ def make_path(self):
**self.QR_PATH_STYLE
)

def to_string(self):
def to_string(self, **kwargs):
img = self._img.__copy__()
img.append(self.make_path())
return ET.tostring(img)
return ET.tostring(img, **kwargs)

def _write(self, stream):
self._img.append(self.make_path())
Expand Down

0 comments on commit 5b9fc76

Please sign in to comment.