Skip to content

Commit 987da3b

Browse files
author
Hugo Osvaldo Barrera
committed
Don't mix up options and writer options
1 parent de3d941 commit 987da3b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ v0.9.0
186186

187187
* Fixed a bug in the API when combining certain barcodes and writers.
188188
* Published documentation again and updated all project references.
189+
* Fix python_barcode.get mixups between `options` as `writer_options`.
190+
Previously, some writer/barcode combinations worked fine, while others
191+
failed. Now all work consistently.
189192

190193
v0.8
191194
~~~~

barcode/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
PROVIDED_BARCODES.sort()
3838

3939

40-
def get(name, code=None, writer=None, options=None):
40+
def get(name, code=None, writer=None, options=None, writer_options=None):
4141
"""Helper method for getting a generator or even a generated code.
4242
4343
:param str name: The name of the type of barcode desired.
@@ -76,13 +76,13 @@ def generate(
7676
writer_options=None,
7777
text=None,
7878
):
79-
options = writer_options or {}
80-
barcode = get(name, code, writer, **options)
79+
writer_options = writer_options or {}
80+
barcode = get(name, code, writer, writer_options=writer_options)
8181
if isinstance(output, str):
82-
fullname = barcode.save(output, options, text)
82+
fullname = barcode.save(output, writer_options, text)
8383
return fullname
8484
else:
85-
barcode.write(output, options, text)
85+
barcode.write(output, writer_options, text)
8686

8787

8888
get_barcode = get

0 commit comments

Comments
 (0)