[PythonReports-checkins] PythonReports/PythonReports barcode.py, 1.3, 1.4
Brought to you by:
a1s
From: alexander s. <a1...@us...> - 2007-11-25 08:48:42
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3155 Modified Files: barcode.py Log Message: fix default value for errors parameter to __call__ Index: barcode.py =================================================================== RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/barcode.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** barcode.py 6 Dec 2006 15:49:57 -0000 1.3 --- barcode.py 25 Nov 2007 08:48:41 -0000 1.4 *************** *** 1,4 **** --- 1,5 ---- """BarCode routines""" """History: + 25-nov-2007 [als] fix default value for errors parameter to __call__ 05-dec-2006 [als] sweep pylint warnings 07-nov-2006 [als] fix doctests (no quet zones encoded) *************** *** 45,49 **** QZ_MILS = 250 ! def __call__(self, text, errors="stict"): """Encode passed text, return sequence of stripe widths --- 46,50 ---- QZ_MILS = 250 ! def __call__(self, text, errors="strict"): """Encode passed text, return sequence of stripe widths *************** *** 223,227 **** return text ! def __call__(self, text, errors="stict"): # ensure that the text contains only digits _text = self._clean(text, errors) --- 224,228 ---- return text ! def __call__(self, text, errors="strict"): # ensure that the text contains only digits _text = self._clean(text, errors) *************** *** 386,390 **** return _rv ! def __call__(self, text, errors="stict"): _codes = self._encode_chars(text, errors) _widths = (1, self.w2n) --- 387,391 ---- return _rv ! def __call__(self, text, errors="strict"): _codes = self._encode_chars(text, errors) _widths = (1, self.w2n) *************** *** 530,533 **** --- 531,541 ---- """Encode text with character set A or B""" _rv = [] + # Note: the speed may be improved by moving try/except + # outside the loop (suggested by yarcat): + # try: + # for _char in text: + # _rv.append(chars.index(_char)) + # except ValueError: + # pass for _char in text: try: *************** *** 585,589 **** return _seq ! def __call__(self, text, errors="stict"): _seq = self._encode(self._clean(text, errors)) # replace code selection character with start character --- 593,597 ---- return _seq ! def __call__(self, text, errors="strict"): _seq = self._encode(self._clean(text, errors)) # replace code selection character with start character |