Skip to content

Commit 75efd93

Browse files
loran425loran425
authored andcommitted
remove lingering debug print statement
1 parent 434f37d commit 75efd93

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

barcode/upc.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ class UniversalProductCodeA(Barcode):
2020
The upc number as string.
2121
writer : barcode.writer Instance
2222
The writer to render the barcode (default: SVGWriter).
23+
make_ean: boolean
2324
"""
2425

2526
name = 'UPC-A'
2627

2728
digits = 11
2829

29-
def __init__(self, upc, writer=None):
30+
def __init__(self, upc, writer=None, make_ean=False):
31+
self.ean = make_ean
3032
upc = upc[:self.digits]
3133
if not upc.isdigit():
3234
raise IllegalCharacterError('UPC code can only contain numbers.')
@@ -38,7 +40,10 @@ def __init__(self, upc, writer=None):
3840
self.writer = writer or Barcode.default_writer()
3941

4042
def __unicode__(self):
41-
return self.upc
43+
if self.ean:
44+
return '0' + self.upc
45+
else:
46+
return self.upc
4247

4348
__str__ = __unicode__
4449

@@ -68,7 +73,6 @@ def build(self):
6873
:return: The pattern as string
6974
:rtype: String
7075
"""
71-
print self.upc
7276
code = _upc.EDGE
7377

7478
for i, number in enumerate(self.upc[0:6]):

0 commit comments

Comments
 (0)