Skip to content

Commit 8b60ada

Browse files
authored
Added products_only argument (from java cli) to decode method. (#9)
1 parent 50432b0 commit 8b60ada

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zxing/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, classpath=None, java=None):
3131
else:
3232
self.classpath = os.path.join(os.path.dirname(__file__), 'java', '*')
3333

34-
def decode(self, filenames, try_harder=False, possible_formats=None, pure_barcode=False):
34+
def decode(self, filenames, try_harder=False, possible_formats=None, pure_barcode=False, products_only=False):
3535
possible_formats = (possible_formats,) if isinstance(possible_formats, str) else possible_formats
3636

3737
if isinstance(filenames, str):
@@ -46,6 +46,8 @@ def decode(self, filenames, try_harder=False, possible_formats=None, pure_barcod
4646
cmd.append('--try_harder')
4747
if pure_barcode:
4848
cmd.append('--pure_barcode')
49+
if products_only:
50+
cmd.append('--products_only')
4951
if possible_formats:
5052
for pf in possible_formats:
5153
cmd += ['--possible_formats', pf ]

0 commit comments

Comments
 (0)