rlextra: minor changes for 2.3 compatibility
authorrgbecker
Wed, 24 May 2006 14:28:40 +0000
changeset 2637 c1bfc581c97a
parent 2636 65ee4afe1b8b
child 2638 ee3e8ad6c3cb
rlextra: minor changes for 2.3 compatibility
reportlab/graphics/barcode/__init__.py
reportlab/graphics/barcode/eanbc.py
--- a/reportlab/graphics/barcode/__init__.py	Wed May 24 11:55:49 2006 +0000
+++ b/reportlab/graphics/barcode/__init__.py	Wed May 24 14:28:40 2006 +0000
@@ -35,17 +35,10 @@
 def getCodes():
     """Returns a dict mapping code names to widgets"""
 
-    from widgets import (BarcodeI2of5,
-                BarcodeCode128,
-                BarcodeStandard93,
-                BarcodeExtended93,
-                BarcodeStandard39,
-                BarcodeExtended39,
-                BarcodeMSI,
-                BarcodeCodabar,
-                BarcodeCode11,
-                BarcodeFIM,
-                BarcodePOSTNET)
+    from widgets import BarcodeI2of5, BarcodeCode128, BarcodeStandard93,\
+                        BarcodeExtended93, BarcodeStandard39, BarcodeExtended39,\
+                        BarcodeMSI, BarcodeCodabar, BarcodeCode11, BarcodeFIM,\
+                        BarcodePOSTNET 
 
     #newer codes will typically get their own module
     from eanbc import Ean13BarcodeWidget, Ean8BarcodeWidget
--- a/reportlab/graphics/barcode/eanbc.py	Wed May 24 11:55:49 2006 +0000
+++ b/reportlab/graphics/barcode/eanbc.py	Wed May 24 14:28:40 2006 +0000
@@ -286,12 +286,12 @@
         c = s[7:]
         gAdd(String(x,y,c,fontName=fontName,fontSize=fontSize,fillColor=textColor,textAnchor='middle'))
 
-    @classmethod
     def _checkdigit(cls,num):
         z = ord('0')
         iSum = cls._0csw*sum([(ord(x)-z) for x in num[::2]]) \
                  + cls._1csw*sum([(ord(x)-z) for x in num[1::2]])
         return chr(z+((10-(iSum%10))%10))
+    _checkdigit=classmethod(_checkdigit)
 
 class isEan8String(Validator):
     def test(self,x):