Skip to content

Commit 1546a3e

Browse files
committed
Pass writer options in get
1 parent 2c3b785 commit 1546a3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

barcode/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
PROVIDED_BARCODES.sort()
5050

5151

52-
def get(name, code=None, writer=None):
52+
def get(name, code=None, writer=None, options=None):
5353
try:
5454
barcode = __BARCODE_MAP[name.lower()]
5555
except KeyError:
5656
raise BarcodeNotFoundError('The barcode {0!r} you requested is not '
5757
'known.'.format(name))
5858
if code is not None:
59-
return barcode(code, writer)
59+
return barcode(code, writer, **options)
6060
else:
6161
return barcode
6262

@@ -68,7 +68,7 @@ def get_class(name):
6868
def generate(name, code, writer=None, output=None, writer_options=None,
6969
text=None, pil=False):
7070
options = writer_options or {}
71-
barcode = get(name, code, writer)
71+
barcode = get(name, code, writer, options)
7272
if pil:
7373
return barcode.render(writer_options, text)
7474
if isinstance(output, _strbase):

0 commit comments

Comments
 (0)