From 71517f78200ddbcaaae755e6b673623b9a541ca9 Mon Sep 17 00:00:00 2001 From: josch Date: Tue, 15 May 2012 22:40:03 +0200 Subject: [PATCH] fix barcode reading bug --- util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util.py b/util.py index 578f573..5a79a23 100644 --- a/util.py +++ b/util.py @@ -83,7 +83,11 @@ def get_pallet(orderline): def get_articles(orderline): articles = list() for o in orderline['Message']['Order']['OrderLines']['OrderLine']: - for barcode in o['Barcodes']['Barcode']: + if isinstance(o['Barcodes']['Barcode'], basestring): + barcodes = [o['Barcodes']['Barcode']] + else: + barcodes = o['Barcodes']['Barcode'] + for barcode in barcodes: articles.append( {'ApproachPoint1': {'X': 0, 'Y': 0, 'Z': 0}, 'ApproachPoint2': {'X': 0, 'Y': 0, 'Z': 0},