summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5394d3)
raw | patch | inline | side by side (parent: f5394d3)
author | Alvin Penner <penner@vaxxine.com> | |
Sun, 20 Dec 2009 22:09:40 +0000 (17:09 -0500) | ||
committer | Alvin Penner <penner@vaxxine.com> | |
Sun, 20 Dec 2009 22:09:40 +0000 (17:09 -0500) |
share/extensions/Barcode/EAN13.py | patch | blob | history | |
share/extensions/Barcode/UPCA.py | patch | blob | history | |
share/extensions/Barcode/UPCE.py | patch | blob | history |
index 3450893fc19cf5a25b2809f81f21d8bc6fc456b3..c79b7749d68840869b906addafbf21a0418cfc3a 100644 (file)
if len(number) == 12:
number = number + self.getChecksum(number)
else:
- if not self.varifyChecksum(number):
- sys.stderr.write("EAN13 Checksum not correct for this barcode, omit last charicter to generate new checksum.\n")
+ if not self.verifyChecksum(number):
+ sys.stderr.write("EAN13 Checksum not correct for this barcode, omit last character to generate new checksum.\n")
return
result = result + guardBar
return str(z)
- def varifyChecksum(self, number):
- new = self.getChecksum(number[:12])
- existing = number[12]
+ def verifyChecksum(self, number):
+ new = self.getChecksum(number[:-1])
+ existing = number[-1]
return new == existing
def getStyle(self, index):
index b67d0830b5d28ead0a1d568ed1f3a2550d6a9b09..89c97eed6e478916cc4cb935902d2761c4217e77 100644 (file)
if len(number) == 11:
number = number + self.getChecksum(number)
else:
- if not self.varifyChecksum(number):
- sys.stderr.write("EAN13 Checksum not correct for this barcode, omit last charicter to generate new checksum.\n")
+ if not self.verifyChecksum(number):
+ sys.stderr.write("UPC-A Checksum not correct for this barcode, omit last character to generate new checksum.\n")
return
result = result + guardBar
index 0ad51868041dee20d6154b398626977f1f1205e7..b41e94e8c9d3019146f5099d68e18cbe687a3494 100644 (file)
if not echeck:
echeck = self.getChecksum(number)
else:
- if not self.varifyChecksum(number + echeck):
- sys.stderr.write("UPC-E Checksum not correct for this barcode, omit last charicter to generate new checksum.\n")
+ if not self.verifyChecksum(number + echeck):
+ sys.stderr.write("UPC-E Checksum not correct for this barcode, omit last character to generate new checksum.\n")
return
number = self.ConvertAtoE(number)