summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 407b5ec)
raw | patch | inline | side by side (parent: 407b5ec)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 8 Feb 2008 07:53:56 +0000 (07:53 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 8 Feb 2008 07:53:56 +0000 (07:53 +0000) |
share/extensions/Barcode/Code128.py | patch | blob | history |
index 0ba9cf2ec9bb1d0c48f5d5623c75bec6d7f65ede..42342c40043c7ebb04bd396ae5268046dc2ac5c1 100644 (file)
'''
Copyright (C) 2007 Martin Owens
+Debugged by Ralf Heinecke & Martin Siepmann 09/07/2007
+
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
the Free Software Foundation; either version 2 of the License, or
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+
'''
from Base import Barcode
# The mapExtra method is used to slim down the amount
# of pre code and instead we generate the lists
-charAB = list(r' !"#$%&\()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQSTUVWXYZ\]^_')
+charAB = list(' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_')
charA = mapExtra(charAB, range(0, 31)) # Offset 64
charB = mapExtra(charAB, range(96, 125)) # Offset -32
def bestBlock(self, block):
# If this has lower case then select B over A
if block.upper() == block:
- return [ 'B', block ]
- return [ 'A', block ]
+ return [ 'A', block ]
+ return [ 'B', block ]
def encodeBlocks(self, blocks):
total = 0
# C : 99, 105
num = 0;
if set == 'A':
- num = 101
+ num = 103
elif set == 'B':
- num = 100
+ num = 104
elif set == 'C':
- num = 99
+ num = 105
i = pos
if pos:
if set == 'A' or set == 'B':
chars = charB
- if set == 'B':
+ if set == 'A':
chars = charA
for char in datum: