reportlab: minor fixes and add strokeDashArray
authorrgbecker
Fri, 14 Jul 2006 09:25:10 +0000
changeset 2660 c147aff8edae
parent 2659 08af1b8a5d05
child 2661 e179247ffea3
reportlab: minor fixes and add strokeDashArray
reportlab/graphics/barcode/code128.py
reportlab/graphics/charts/barcharts.py
reportlab/platypus/flowables.py
reportlab/test/test_platypus_breaking.py
--- a/reportlab/graphics/barcode/code128.py	Wed Jul 12 07:48:21 2006 +0000
+++ b/reportlab/graphics/barcode/code128.py	Fri Jul 14 09:25:10 2006 +0000
@@ -255,7 +255,7 @@
         while c < len(l):
             i = (-c - 1)
             if l[i] == '\xf1':
-                c = c + 1
+                c += 1
                 rl.insert(0, '\xf1')
                 continue
             elif len(l[i]) == 1 and l[i] in digits \
--- a/reportlab/graphics/charts/barcharts.py	Wed Jul 12 07:48:21 2006 +0000
+++ b/reportlab/graphics/charts/barcharts.py	Fri Jul 14 09:25:10 2006 +0000
@@ -16,7 +16,7 @@
 from reportlab.lib import colors
 from reportlab.lib.validators import isNumber, isColor, isColorOrNone, isString,\
             isListOfStrings, SequenceOf, isBoolean, isNoneOrShape, isStringOrNone,\
-            NoneOr
+            NoneOr, isListOfNumbersOrNone
 from reportlab.graphics.widgets.markers import uSymbol2Symbol, isSymbol
 from reportlab.lib.formatters import Formatter
 from reportlab.lib.attrmap import AttrMap, AttrMapValue
@@ -32,6 +32,7 @@
         strokeColor = AttrMapValue(isColorOrNone, desc='Color of the bar border.'),
         fillColor = AttrMapValue(isColorOrNone, desc='Color of the bar interior area.'),
         strokeWidth = AttrMapValue(isNumber, desc='Width of the bar border.'),
+        strokeDashArray = AttrMapValue(isListOfNumbersOrNone, desc='Dash array of a line.'),
         symbol = AttrMapValue(None, desc='A widget to be used instead of a normal bar.'),
         name = AttrMapValue(isString, desc='Text to be associated with a bar (eg seriesname)'),
         swatchMarker = AttrMapValue(NoneOr(isSymbol), desc="None or makeMarker('Diamond') ..."),
@@ -133,14 +134,14 @@
         # colors e.g. from Tufte.  These will be used in a
         # cycle to set the fill color of each series.
         self.bars = TypedPropertyCollection(BarChartProperties)
-##        self.bars.symbol = None
         self.bars.strokeWidth = 1
         self.bars.strokeColor = colors.black
+        self.bars.strokeDashArray = None
 
         self.bars[0].fillColor = colors.red
         self.bars[1].fillColor = colors.green
         self.bars[2].fillColor = colors.blue
-        self.naLabel = None#NA_Label()
+        self.naLabel = None #NA_Label()
 
 
     def demo(self):
@@ -419,6 +420,8 @@
         r.strokeWidth = style.strokeWidth
         r.fillColor = style.fillColor
         r.strokeColor = style.strokeColor
+        if style.strokeDashArray:
+            r.strokeDashArray = style.strokeDashArray
         g.add(r)
 
     def _makeBars(self,g,lg):
--- a/reportlab/platypus/flowables.py	Wed Jul 12 07:48:21 2006 +0000
+++ b/reportlab/platypus/flowables.py	Fri Jul 14 09:25:10 2006 +0000
@@ -447,6 +447,7 @@
     pS = 0
     atTop = 1
     for f in F:
+        if hasattr(f,'frameAction'): continue
         w,h = f.wrapOn(canv,availWidth,0xfffffff)
         if dims is not None: dims.append((w,h))
         if w<=_FUZZ or h<=_FUZZ: continue
--- a/reportlab/test/test_platypus_breaking.py	Wed Jul 12 07:48:21 2006 +0000
+++ b/reportlab/test/test_platypus_breaking.py	Fri Jul 14 09:25:10 2006 +0000
@@ -101,7 +101,7 @@
         _test0(self)
 
     def test1(self):
-        '''Ilpo Nyyssönen posted this broken test'''
+        '''Ilpo Nyyss\xf6nen posted this broken test'''
         normalStyle = ParagraphStyle(name = 'normal')
         keepStyle = ParagraphStyle(name = 'keep', keepWithNext = True)
         content = [