Code

patch by Horst Schottky for LP 529114
authorAlvin Penner <penner@vaxxine.com>
Sun, 28 Feb 2010 22:40:23 +0000 (17:40 -0500)
committerAlvin Penner <penner@vaxxine.com>
Sun, 28 Feb 2010 22:40:23 +0000 (17:40 -0500)
share/extensions/Barcode/Code128.py

index 42342c40043c7ebb04bd396ae5268046dc2ac5c1..2f0b327ed44a988274efe53d1b390edca6ecb4d1 100644 (file)
@@ -2,6 +2,7 @@
 Copyright (C) 2007 Martin Owens
 
 Debugged by Ralf Heinecke & Martin Siepmann 09/07/2007
+Debugged by Horst Schottky Feb. 27. 2010
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -51,7 +52,7 @@ class Object(Barcode):
                # Split up into sections of numbers, or charicters
                # This makes sure that all the charicters are encoded
                # In the best way posible for Code128
-               for datum in re.findall(r'(?:(?:\d\d){2,})|.', text):
+               for datum in re.findall(r'(?:(?:\d\d){2,})|(?:^\d\d)|.', text):
                        if len(datum) == 1:
                                block = block + datum
                        else:
@@ -96,7 +97,7 @@ class Object(Barcode):
 
                        i = pos
                        if pos:
-                               num = num + (math.abs(num - 102) * 2)
+                               num = 204 - num
                        else:
                                i = 1