Skip to content

Commit acfcd7d

Browse files
author
Hugo Osvaldo Barrera
committed
Standardize how options are passed to barcodes
Closes #47
1 parent 1f1acf8 commit acfcd7d

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

barcode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def generate(
7878
pil=False
7979
):
8080
options = writer_options or {}
81-
barcode = get(name, code, writer, options)
81+
barcode = get(name, code, writer, **options)
8282
if pil:
8383
return barcode.render(writer_options, text)
8484
if isinstance(output, str):

barcode/ean.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ class EuropeanArticleNumber13(Barcode):
4747

4848
digits = 12
4949

50-
def __init__(self, ean, writer=None, **kwargs):
51-
no_checksum = False
52-
if "no_checksum" in kwargs.keys():
53-
no_checksum = kwargs["no_checksum"]
50+
def __init__(self, ean, writer=None, no_checksum=False):
5451
ean = ean[:self.digits]
5552
if not ean.isdigit():
5653
raise IllegalCharacterError('EAN code can only contain numbers.')

0 commit comments

Comments
 (0)