class TrendlineLabel(Serialisable): tagname = "trendlineLbl" layout = Typed(expected_type=Layout, allow_none=True) tx = Typed(expected_type=Text, allow_none=True) numFmt = Typed(expected_type=NumFmt, allow_none=True) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias("spPr") txPr = Typed(expected_type=RichText, allow_none=True) textProperties = Alias("txPr") extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('layout', 'tx', 'numFmt', 'spPr', 'txPr') def __init__(self, layout=None, tx=None, numFmt=None, spPr=None, txPr=None, extLst=None, ): self.layout = layout self.tx = tx self.numFmt = numFmt self.spPr = spPr self.txPr = txPr
class Shape(Serialisable): macro = String(allow_none=True) textlink = String(allow_none=True) fPublished = Bool(allow_none=True) fLocksText = Bool(allow_none=True) nvSpPr = Typed(expected_type=ShapeMeta, allow_none=True) meta = Alias("nvSpPr") spPr = Typed(expected_type=GraphicalProperties) graphicalProperties = Alias("spPr") style = Typed(expected_type=ShapeStyle, allow_none=True) txBody = Typed(expected_type=RichText, allow_none=True) def __init__( self, macro=None, textlink=None, fPublished=None, fLocksText=None, nvSpPr=None, spPr=None, style=None, txBody=None, ): self.macro = macro self.textlink = textlink self.fPublished = fPublished self.fLocksText = fLocksText self.nvSpPr = nvSpPr self.spPr = spPr self.style = style self.txBody = txBody
class Title(Serialisable): tagname = "title" tx = Typed(expected_type=Text, allow_none=True) text = Alias('tx') layout = Typed(expected_type=Layout, allow_none=True) overlay = NestedBool(allow_none=True) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias('spPr') txPr = Typed(expected_type=RichText, allow_none=True) body = Alias('txPr') extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('tx', 'layout', 'overlay', 'spPr', 'txPr') def __init__(self, tx=None, layout=None, overlay=None, spPr=None, txPr=None, extLst=None, ): if tx is None: tx = Text() self.tx = tx self.layout = layout self.overlay = overlay self.spPr = spPr self.txPr = txPr
class Paragraph(Serialisable): tagname = "p" namespace = DRAWING_NS # uses element group EG_TextRun pPr = Typed(expected_type=ParagraphProperties, allow_none=True) properties = Alias("pPr") endParaRPr = Typed(expected_type=CharacterProperties, allow_none=True) r = Sequence(expected_type=RegularTextRun) text = Alias('r') br = Typed(expected_type=LineBreak, allow_none=True) fld = Typed(expected_type=TextField, allow_none=True) __elements__ = ('pPr', 'r', 'br', 'fld', 'endParaRPr') def __init__( self, pPr=None, endParaRPr=None, r=None, br=None, fld=None, ): self.pPr = pPr self.endParaRPr = endParaRPr if r is None: r = [RegularTextRun()] self.r = r self.br = br self.fld = fld
class Legend(Serialisable): tagname = "legend" legendPos = NestedSet(values=(['b', 'tr', 'l', 'r', 't'])) position = Alias('legendPos') legendEntry = Sequence(expected_type=LegendEntry) layout = Typed(expected_type=Layout, allow_none=True) overlay = NestedBool(allow_none=True) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias('spPr') txPr = Typed(expected_type=RichText, allow_none=True) textProperties = Alias('txPr') extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('legendPos', 'legendEntry', 'layout', 'overlay', 'spPr', 'txPr',) def __init__(self, legendPos="r", legendEntry=(), layout=None, overlay=None, spPr=None, txPr=None, extLst=None, ): self.legendPos = legendPos self.legendEntry = legendEntry self.layout = layout self.overlay = overlay self.spPr = spPr self.txPr = txPr
class _AnchorBase(Serialisable): #one of sp = Typed(expected_type=Shape, allow_none=True) shape = Alias("sp") grpSp = Typed(expected_type=GroupShape, allow_none=True) groupShape = Alias("grpSp") graphicFrame = Typed(expected_type=GraphicFrame, allow_none=True) cxnSp = Typed(expected_type=Shape, allow_none=True) connectionShape = Alias("cxnSp") pic = Typed(expected_type=PictureFrame, allow_none=True) contentPart = Relation() clientData = Typed(expected_type=AnchorClientData) __elements__ = ('sp', 'grpSp', 'graphicFrame', 'cxnSp', 'pic', 'contentPart', 'clientData') def __init__(self, clientData=None, sp=None, grpSp=None, graphicFrame=None, cxnSp=None, pic=None, contentPart=None): if clientData is None: clientData = AnchorClientData() self.clientData = clientData self.sp = sp self.grpSp = grpSp self.graphicFrame = graphicFrame self.cxnSp = cxnSp self.pic = pic self.contentPart = contentPart
class DisplayUnitsLabel(Serialisable): tagname = "dispUnitsLbl" layout = Typed(expected_type=Layout, allow_none=True) tx = Typed(expected_type=Text, allow_none=True) text = Alias("tx") spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias("spPr") txPr = Typed(expected_type=RichText, allow_none=True) textPropertes = Alias("txPr") __elements__ = ('layout', 'tx', 'spPr', 'txPr') def __init__( self, layout=None, tx=None, spPr=None, txPr=None, ): self.layout = layout self.tx = tx self.spPr = spPr self.txPr = txPr
class RichText(Serialisable): """ From the specification: 21.2.2.216 This element specifies text formatting. The lstStyle element is not supported. """ tagname = "rich" bodyPr = Typed(expected_type=RichTextProperties) properties = Alias("bodyPr") lstStyle = Typed(expected_type=ListStyle, allow_none=True) p = Sequence(expected_type=Paragraph) paragraphs = Alias('p') __elements__ = ("bodyPr", "lstStyle", "p") def __init__(self, bodyPr=None, lstStyle=None, p=None, ): if bodyPr is None: bodyPr = RichTextProperties() self.bodyPr = bodyPr self.lstStyle = lstStyle if p is None: p = [Paragraph()] self.p = p
class GradientFillProperties(Serialisable): tagname = "gradFill" namespace = DRAWING_NS flip = NoneSet(values=(['x', 'y', 'xy'])) rotWithShape = Bool(allow_none=True) gsLst = NestedSequence(expected_type=GradientStop, count=False) stop_list = Alias("gsLst") lin = Typed(expected_type=LinearShadeProperties, allow_none=True) linear = Alias("lin") path = Typed(expected_type=PathShadeProperties, allow_none=True) tileRect = Typed(expected_type=RelativeRect, allow_none=True) __elements__ = ('gsLst', 'lin', 'path', 'tileRect') def __init__(self, flip=None, rotWithShape=None, gsLst=(), lin=None, path=None, tileRect=None, ): self.flip = flip self.rotWithShape = rotWithShape self.gsLst = gsLst self.lin = lin self.path = path self.tileRect = tileRect
class _BarChartBase(ChartBase): barDir = NestedSet(values=(['bar', 'col'])) type = Alias("barDir") grouping = NestedSet( values=(['percentStacked', 'clustered', 'standard', 'stacked'])) varyColors = NestedBool(nested=True, allow_none=True) ser = Sequence(expected_type=Series, allow_none=True) dLbls = Typed(expected_type=DataLabelList, allow_none=True) dataLabels = Alias("dLbls") __elements__ = ('barDir', 'grouping', 'varyColors', 'ser', 'dLbls') _series_type = "bar" def __init__(self, barDir="col", grouping="clustered", varyColors=None, ser=(), dLbls=None, **kw): self.barDir = barDir self.grouping = grouping self.varyColors = varyColors self.ser = ser self.dLbls = dLbls super(_BarChartBase, self).__init__(**kw)
class SolidColorFillProperties(Serialisable): tagname = "solidFill" # uses element group EG_ColorChoice scrgbClr = Typed(expected_type=RGBPercent, allow_none=True) RGBPercent = Alias('scrgbClr') srgbClr = NestedValue(expected_type=unicode, allow_none=True) # needs pattern and can have transform RGB = Alias('srgbClr') hslClr = Typed(expected_type=HSLColor, allow_none=True) sysClr = Typed(expected_type=SystemColor, allow_none=True) schemeClr = Typed(expected_type=SchemeColor, allow_none=True) prstClr = NestedNoneSet(values=PRESET_COLORS) __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr') def __init__(self, scrgbClr=None, srgbClr=None, hslClr=None, sysClr=None, schemeClr=None, prstClr=None, ): self.scrgbClr = scrgbClr self.srgbClr = srgbClr self.hslClr = hslClr self.sysClr = sysClr self.schemeClr = schemeClr self.prstClr = prstClr
class Relationship(Serialisable): """Represents many kinds of relationships.""" tagname = "Relationship" Type = String() Target = String() target = Alias("Target") TargetMode = String(allow_none=True) Id = String(allow_none=True) id = Alias("Id") def __init__(self, Id=None, Type=None, type=None, Target=None, TargetMode=None): """ `type` can be used as a shorthand with the default relationships namespace otherwise the `Type` must be a fully qualified URL """ if type is not None: Type = "%s/%s" % (REL_NS, type) self.Type = Type self.Target = Target self.TargetMode = TargetMode self.Id = Id
class PatternFillProperties(Serialisable): tagname = "pattFill" namespace = DRAWING_NS prst = NoneSet(values=(['pct5', 'pct10', 'pct20', 'pct25', 'pct30', 'pct40', 'pct50', 'pct60', 'pct70', 'pct75', 'pct80', 'pct90', 'horz', 'vert', 'ltHorz', 'ltVert', 'dkHorz', 'dkVert', 'narHorz', 'narVert', 'dashHorz', 'dashVert', 'cross', 'dnDiag', 'upDiag', 'ltDnDiag', 'ltUpDiag', 'dkDnDiag', 'dkUpDiag', 'wdDnDiag', 'wdUpDiag', 'dashDnDiag', 'dashUpDiag', 'diagCross', 'smCheck', 'lgCheck', 'smGrid', 'lgGrid', 'dotGrid', 'smConfetti', 'lgConfetti', 'horzBrick', 'diagBrick', 'solidDmnd', 'openDmnd', 'dotDmnd', 'plaid', 'sphere', 'weave', 'divot', 'shingle', 'wave', 'trellis', 'zigZag'])) preset = Alias("prst") fgClr = Typed(expected_type=ColorChoice, allow_none=True) foreground = Alias("fgClr") bgClr = Typed(expected_type=ColorChoice, allow_none=True) background = Alias("bgClr") __elements__ = ("fgClr", "bgClr") def __init__(self, prst=None, fgClr=None, bgClr=None, ): self.prst = prst self.fgClr = fgClr self.bgClr = bgClr
class ChartSpace(Serialisable): tagname = "chartSpace" date1904 = NestedBool(allow_none=True) lang = NestedString(allow_none=True) roundedCorners = NestedBool(allow_none=True) style = NestedMinMax(allow_none=True, min=1, max=48) clrMapOvr = Typed(expected_type=ColorMapping, allow_none=True) pivotSource = Typed(expected_type=PivotSource, allow_none=True) protection = Typed(expected_type=Protection, allow_none=True) chart = Typed(expected_type=ChartContainer) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias("spPr") txPr = Typed(expected_type=RichText, allow_none=True) textProperties = Alias("txPr") externalData = Typed(expected_type=ExternalData, allow_none=True) printSettings = Typed(expected_type=PrintSettings, allow_none=True) userShapes = Relation() extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('date1904', 'lang', 'roundedCorners', 'style', 'clrMapOvr', 'pivotSource', 'protection', 'chart', 'spPr', 'txPr', 'externalData', 'printSettings', 'userShapes') def __init__( self, date1904=None, lang=None, roundedCorners=None, style=None, clrMapOvr=None, pivotSource=None, protection=None, chart=None, spPr=None, txPr=None, externalData=None, printSettings=None, userShapes=None, extLst=None, ): self.date1904 = date1904 self.lang = lang self.roundedCorners = roundedCorners self.style = style self.clrMapOvr = clrMapOvr self.pivotSource = pivotSource self.protection = protection self.chart = chart self.spPr = spPr self.txPr = txPr self.externalData = externalData self.printSettings = printSettings self.userShapes = userShapes def to_tree(self, tagname=None, idx=None, namespace=None): tree = super(ChartSpace, self).to_tree() tree.set("xmlns", CHART_NS) return tree
class PivotFormat(Serialisable): tagname = "pivotFmt" idx = NestedInteger(nested=True) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias("spPr") txPr = Typed(expected_type=RichText, allow_none=True) TextBody = Alias("txPr") marker = Typed(expected_type=Marker, allow_none=True) dLbl = Typed(expected_type=DataLabel, allow_none=True) DataLabel = Alias("dLbl") extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('idx', 'spPr', 'txPr', 'marker', 'dLbl') def __init__( self, idx=0, spPr=None, txPr=None, marker=None, dLbl=None, extLst=None, ): self.idx = idx self.spPr = spPr self.txPr = txPr self.marker = marker self.dLbl = dLbl
class RowDimension(Dimension): """Information about the display properties of a row.""" __fields__ = Dimension.__fields__ + ('ht', 'customFormat', 'customHeight', 's', 'thickBot', 'thickTop') r = Alias('index') s = Alias('style_id') ht = Float(allow_none=True) height = Alias('ht') thickBot = Bool() thickTop = Bool() def __init__( self, worksheet, index=0, ht=None, customHeight=None, # do not write s=None, customFormat=None, # do not write hidden=False, outlineLevel=0, outline_level=None, collapsed=False, visible=None, height=None, r=None, spans=None, thickBot=None, thickTop=None, **kw): if r is not None: index = r if height is not None: ht = height self.ht = ht if visible is not None: hidden = not visible if outline_level is not None: outlineLevel = outline_level self.thickBot = thickBot self.thickTop = thickTop super(RowDimension, self).__init__(index, hidden, outlineLevel, collapsed, worksheet, style=s) @property def customFormat(self): """Always true if there is a style for the row""" return self.has_style @property def customHeight(self): """Always true if there is a height for the row""" return self.ht is not None
class _DataLabelBase(Serialisable): numFmt = NestedString(allow_none=True, attribute="formatCode") spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias('spPr') txPr = Typed(expected_type=RichText, allow_none=True) textProperties = Alias('txPr') dLblPos = NestedNoneSet(values=['bestFit', 'b', 'ctr', 'inBase', 'inEnd', 'l', 'outEnd', 'r', 't']) position = Alias('dLblPos') showLegendKey = NestedBool(allow_none=True) showVal = NestedBool(allow_none=True) showCatName = NestedBool(allow_none=True) showSerName = NestedBool(allow_none=True) showPercent = NestedBool(allow_none=True) showBubbleSize = NestedBool(allow_none=True) showLeaderLines = NestedBool(allow_none=True) separator = NestedString(allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ("numFmt", "spPr", "txPr", "dLblPos", "showLegendKey", "showVal", "showCatName", "showSerName", "showPercent", "showBubbleSize", "showLeaderLines", "separator") def __init__(self, numFmt=None, spPr=None, txPr=None, dLblPos=None, showLegendKey=None, showVal=None, showCatName=None, showSerName=None, showPercent=None, showBubbleSize=None, showLeaderLines=None, separator=None, extLst=None, ): self.numFmt = numFmt self.spPr = spPr self.txPr = txPr self.dLblPos = dLblPos self.showLegendKey = showLegendKey self.showVal = showVal self.showCatName = showCatName self.showSerName = showSerName self.showPercent = showPercent self.showBubbleSize = showBubbleSize self.showLeaderLines = showLeaderLines self.separator = separator
class ProjectedPieChart(_PieChartBase): """ From the spec 21.2.2.126 This element contains the pie of pie or bar of pie series on this chart. Only the first series shall be displayed. The splitType element shall determine whether the splitPos and custSplit elements apply. """ tagname = "ofPieChart" varyColors = _PieChartBase.varyColors ser = _PieChartBase.ser dLbls = _PieChartBase.dLbls ofPieType = NestedSet(values=(['pie', 'bar'])) type = Alias('ofPieType') gapWidth = NestedGapAmount() splitType = NestedNoneSet( values=(['auto', 'cust', 'percent', 'pos', 'val'])) splitPos = NestedFloat(allow_none=True) custSplit = Typed(expected_type=CustomSplit, allow_none=True) secondPieSize = NestedMinMax(min=5, max=200, allow_none=True) serLines = Typed(expected_type=ChartLines, allow_none=True) join_lines = Alias('serLines') extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = _PieChartBase.__elements__ + ( 'ofPieType', 'gapWidth', 'splitType', 'splitPos', 'custSplit', 'secondPieSize', 'serLines') def __init__(self, ofPieType="pie", gapWidth=None, splitType="auto", splitPos=None, custSplit=None, secondPieSize=75, serLines=None, extLst=None, **kw): self.ofPieType = ofPieType self.gapWidth = gapWidth self.splitType = splitType self.splitPos = splitPos self.custSplit = custSplit self.secondPieSize = secondPieSize if serLines is None: self.serLines = ChartLines() super(ProjectedPieChart, self).__init__(**kw)
class PictureFrame(Serialisable): tagname = "pic" macro = String(allow_none=True) fPublished = Bool(allow_none=True) nvPicPr = Typed(expected_type=PictureNonVisual, ) blipFill = Typed(expected_type=BlipFillProperties, ) spPr = Typed(expected_type=GraphicalProperties, ) graphicalProperties = Alias('spPr') style = Typed(expected_type=ShapeStyle, allow_none=True) __elements__ = ("nvPicPr", "blipFill", "spPr", "style") def __init__( self, macro=None, fPublished=None, nvPicPr=None, blipFill=None, spPr=None, style=None, ): self.macro = macro self.fPublished = fPublished if nvPicPr is None: nvPicPr = PictureNonVisual() self.nvPicPr = nvPicPr if blipFill is None: blipFill = BlipFillProperties() self.blipFill = blipFill if spPr is None: spPr = GraphicalProperties() self.spPr = spPr self.style = style
class DataTable(Serialisable): tagname = "dTable" showHorzBorder = NestedBool(allow_none=True) showVertBorder = NestedBool(allow_none=True) showOutline = NestedBool(allow_none=True) showKeys = NestedBool(allow_none=True) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias('spPr') txPr = Typed(expected_type=RichText, allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('showHorzBorder', 'showVertBorder', 'showOutline', 'showKeys', 'spPr', 'txPr') def __init__( self, showHorzBorder=None, showVertBorder=None, showOutline=None, showKeys=None, spPr=None, txPr=None, extLst=None, ): self.showHorzBorder = showHorzBorder self.showVertBorder = showVertBorder self.showOutline = showOutline self.showKeys = showKeys self.spPr = spPr self.txPr = txPr
class Marker(Serialisable): tagname = "marker" symbol = NestedNoneSet(values=([ 'circle', 'dash', 'diamond', 'dot', 'picture', 'plus', 'square', 'star', 'triangle', 'x', 'auto' ]), to_tree=_explicit_none) size = NestedMinMax(min=2, max=72, allow_none=True) spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias('spPr') extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('symbol', 'size', 'spPr') def __init__( self, symbol=None, size=None, spPr=None, extLst=None, ): self.symbol = symbol self.size = size if spPr is None: spPr = GraphicalProperties() self.spPr = spPr
class _AreaChartBase(ChartBase): grouping = NestedSet(values=(['percentStacked', 'standard', 'stacked'])) varyColors = NestedBool(nested=True, allow_none=True) ser = Sequence(expected_type=Series, allow_none=True) dLbls = Typed(expected_type=DataLabelList, allow_none=True) dataLabels = Alias("dLbls") dropLines = Typed(expected_type=ChartLines, allow_none=True) _series_type = "area" __elements__ = ('grouping', 'varyColors', 'ser', 'dLbls', 'dropLines') def __init__( self, grouping="standard", varyColors=None, ser=(), dLbls=None, dropLines=None, ): self.grouping = grouping self.varyColors = varyColors self.ser = ser self.dLbls = dLbls self.dropLines = dropLines super(_AreaChartBase, self).__init__()
class DashStop(Serialisable): tagname = "ds" namespace = DRAWING_NS d = Integer() length = Alias('d') sp = Integer() space = Alias('sp') def __init__( self, d=0, sp=0, ): self.d = d self.sp = sp
class RichText(Serialisable): tagname = "RElt" rPr = Typed(expected_type=InlineFont, allow_none=True) font = Alias("rPr") t = NestedText(expected_type=unicode, allow_none=True) text = Alias("t") __elements__ = ('rPr', 't') def __init__( self, rPr=None, t=None, ): self.rPr = rPr self.t = t
class GroupShape(Serialisable): nvGrpSpPr = Typed(expected_type=NonVisualGroupShape) nonVisualProperties = Alias("nvGrpSpPr") grpSpPr = Typed(expected_type=GroupShapeProperties) visualProperties = Alias("grpSpPr") pic = Typed(expected_type=PictureFrame, allow_none=True) __elements__ = ["nvGrpSpPr", "grpSpPr", "pic"] def __init__(self, nvGrpSpPr=None, grpSpPr=None, pic=None, ): self.nvGrpSpPr = nvGrpSpPr self.grpSpPr = grpSpPr self.pic = pic
class ChartLines(Serialisable): tagname = "chartLines" spPr = Typed(expected_type=GraphicalProperties, allow_none=True) graphicalProperties = Alias('spPr') def __init__(self, spPr=None): self.spPr = spPr
class RegularTextRun(Serialisable): tagname = "r" namespace = DRAWING_NS rPr = Typed(expected_type=CharacterProperties, allow_none=True) properties = Alias("rPr") t = NestedText(expected_type=unicode) value = Alias("t") __elements__ = ('rPr', 't') def __init__( self, rPr=None, t="", ): self.rPr = rPr self.t = t
class ManualLayout(Serialisable): tagname = "manualLayout" layoutTarget = NestedNoneSet(values=(['inner', 'outer'])) xMode = NestedNoneSet(values=(['edge', 'factor'])) yMode = NestedNoneSet(values=(['edge', 'factor'])) wMode = NestedSet(values=(['edge', 'factor'])) hMode = NestedSet(values=(['edge', 'factor'])) x = NestedMinMax(min=-1, max=1, allow_none=True) y = NestedMinMax(min=-1, max=1, allow_none=True) w = NestedMinMax(min=0, max=1, allow_none=True) width = Alias('w') h = NestedMinMax(min=0, max=1, allow_none=True) height = Alias('h') extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('layoutTarget', 'xMode', 'yMode', 'wMode', 'hMode', 'x', 'y', 'w', 'h') def __init__( self, layoutTarget=None, xMode=None, yMode=None, wMode="factor", hMode="factor", x=None, y=None, w=None, h=None, extLst=None, ): self.layoutTarget = layoutTarget self.xMode = xMode self.yMode = yMode self.wMode = wMode self.hMode = hMode self.x = x self.y = y self.w = w self.h = h
class Dimension(Strict, StyleableObject): """Information about the display properties of a row or column.""" __fields__ = ( 'hidden', 'outlineLevel', 'collapsed', ) index = Integer() hidden = Bool() outlineLevel = Integer(allow_none=True) outline_level = Alias('outlineLevel') collapsed = Bool() style = Alias('style_id') def __init__(self, index, hidden, outlineLevel, collapsed, worksheet, visible=True, style=None): super(Dimension, self).__init__(sheet=worksheet, style_array=style) self.index = index self.hidden = hidden self.outlineLevel = outlineLevel self.collapsed = collapsed def __iter__(self): for key in self.__fields__: value = getattr(self, key, None) if value: yield key, safe_string(value) def __copy__(self): cp = self.__new__(self.__class__) attrib = self.__dict__ attrib['worksheet'] = self.parent cp.__init__(**attrib) cp._style = copy(self._style) return cp
class PositiveSize2D(Serialisable): tagname = "ext" namespace = DRAWING_NS """ Dimensions in EMUs """ cx = Integer() width = Alias('cx') cy = Integer() height = Alias('cy') def __init__( self, cx=None, cy=None, ): self.cx = cx self.cy = cy