class OleObject(Serialisable): tagname = "oleObject" objectPr = Typed(expected_type=ObjectPr, allow_none=True) progId = String(allow_none=True) dvAspect = Set(values=(['DVASPECT_CONTENT', 'DVASPECT_ICON'])) link = String(allow_none=True) oleUpdate = Set(values=(['OLEUPDATE_ALWAYS', 'OLEUPDATE_ONCALL'])) autoLoad = Bool(allow_none=True) shapeId = Integer() __elements__ = ('objectPr', ) def __init__( self, objectPr=None, progId=None, dvAspect='DVASPECT_CONTENT', link=None, oleUpdate=None, autoLoad=False, shapeId=None, ): self.objectPr = objectPr self.progId = progId self.dvAspect = dvAspect self.link = link self.oleUpdate = oleUpdate self.autoLoad = autoLoad self.shapeId = shapeId
class Alignment(HashableObject): """Alignment options for use in styles.""" __fields__ = ('horizontal', 'vertical', 'text_rotation', 'wrap_text', 'shrink_to_fit', 'indent') horizontal = Set(values=alignments) vertical = Set(values=alignments) text_rotation = Integer() wrap_text = Bool() shrink_to_fit = Bool() indent = Integer() def __init__(self, horizontal=HORIZONTAL_GENERAL, vertical=VERTICAL_BOTTOM, text_rotation=0, wrap_text=False, shrink_to_fit=False, indent=0): self.horizontal = horizontal self.vertical = vertical self.text_rotation = text_rotation self.wrap_text = wrap_text self.shrink_to_fit = shrink_to_fit self.indent = indent
class Properties(Serialisable): locked = Bool(allow_none=True) defaultSize = Bool(allow_none=True) _print = Bool(allow_none=True) disabled = Bool(allow_none=True) uiObject = Bool(allow_none=True) autoFill = Bool(allow_none=True) autoLine = Bool(allow_none=True) altText = String(allow_none=True) textHAlign = Set( values=(['left', 'center', 'right', 'justify', 'distributed'])) textVAlign = Set( values=(['top', 'center', 'bottom', 'justify', 'distributed'])) lockText = Bool(allow_none=True) justLastX = Bool(allow_none=True) autoScale = Bool(allow_none=True) rowHidden = Bool(allow_none=True) colHidden = Bool(allow_none=True) anchor = Typed(expected_type=ObjectAnchor, ) __elements__ = ('anchor', ) def __init__( self, locked=None, defaultSize=None, _print=None, disabled=None, uiObject=None, autoFill=None, autoLine=None, altText=None, textHAlign=None, textVAlign=None, lockText=None, justLastX=None, autoScale=None, rowHidden=None, colHidden=None, anchor=None, ): self.locked = locked self.defaultSize = defaultSize self._print = _print self.disabled = disabled self.uiObject = uiObject self.autoFill = autoFill self.autoLine = autoLine self.altText = altText self.textHAlign = textHAlign self.textVAlign = textVAlign self.lockText = lockText self.justLastX = justLastX self.autoScale = autoScale self.rowHidden = rowHidden self.colHidden = colHidden self.anchor = anchor
class Alignment(HashableObject): """Alignment options for use in styles.""" __fields__ = ( 'horizontal', 'vertical', 'textRotation', 'wrapText', 'shrinkToFit', 'indent', 'relativeIndent', 'justifyLastLine', 'readingOrder', ) horizontal = Set(values=horizontal_alignments) vertical = Set(values=vertical_aligments) textRotation = MinMax(min=0, max=180) text_rotation = Alias('textRotation') wrapText = Bool() wrap_text = Alias('wrapText') shrinkToFit = Bool() shrink_to_fit = Alias('shrinkToFit') indent = Min(min=0) relativeIndent = Min(min=0) justifyLastLine = Bool() readingOrder = Min(min=0) def __init__(self, horizontal='general', vertical='bottom', textRotation=0, wrapText=False, shrinkToFit=False, indent=0, relativeIndent=0, justifyLastLine=False, readingOrder=0, text_rotation=None, wrap_text=None, shrink_to_fit=None): self.horizontal = horizontal self.vertical = vertical self.indent = indent self.relativeIndent = relativeIndent self.justifyLastLine = justifyLastLine self.readingOrder = readingOrder if text_rotation is not None: textRotation = text_rotation self.textRotation = textRotation if wrap_text is not None: wrapText = wrap_text self.wrapText = wrapText if shrink_to_fit is not None: shrinkToFit = shrink_to_fit self.shrinkToFit = shrinkToFit
class DynamicFilter(Serialisable): tagname = "dynamicFilter" type = Set(values=([ 'null', 'aboveAverage', 'belowAverage', 'tomorrow', 'today', 'yesterday', 'nextWeek', 'thisWeek', 'lastWeek', 'nextMonth', 'thisMonth', 'lastMonth', 'nextQuarter', 'thisQuarter', 'lastQuarter', 'nextYear', 'thisYear', 'lastYear', 'yearToDate', 'Q1', 'Q2', 'Q3', 'Q4', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12' ])) val = Float(allow_none=True) valIso = DateTime(allow_none=True) maxVal = Float(allow_none=True) maxValIso = DateTime(allow_none=True) def __init__( self, type=None, val=None, valIso=None, maxVal=None, maxValIso=None, ): self.type = type self.val = val self.valIso = valIso self.maxVal = maxVal self.maxValIso = maxValIso
class PivotFilter(Serialisable): fld = Integer() mpFld = Integer(allow_none=True) type = Set(values=(['unknown', 'count', 'percent', 'sum', 'captionEqual', 'captionNotEqual', 'captionBeginsWith', 'captionNotBeginsWith', 'captionEndsWith', 'captionNotEndsWith', 'captionContains', 'captionNotContains', 'captionGreaterThan', 'captionGreaterThanOrEqual', 'captionLessThan', 'captionLessThanOrEqual', 'captionBetween', 'captionNotBetween', 'valueEqual', 'valueNotEqual', 'valueGreaterThan', 'valueGreaterThanOrEqual', 'valueLessThan', 'valueLessThanOrEqual', 'valueBetween', 'valueNotBetween', 'dateEqual', 'dateNotEqual', 'dateOlderThan', 'dateOlderThanOrEqual', 'dateNewerThan', 'dateNewerThanOrEqual', 'dateBetween', 'dateNotBetween', 'tomorrow', 'today', 'yesterday', 'nextWeek', 'thisWeek', 'lastWeek', 'nextMonth', 'thisMonth', 'lastMonth', 'nextQuarter', 'thisQuarter', 'lastQuarter', 'nextYear', 'thisYear', 'lastYear', 'yearToDate', 'Q1', 'Q2', 'Q3', 'Q4', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12'])) evalOrder = Integer(allow_none=True) id = Integer() iMeasureHier = Integer(allow_none=True) iMeasureFld = Integer(allow_none=True) name = String(allow_none=True) description = String() stringValue1 = String() stringValue2 = String() autoFilter = Typed(expected_type=AutoFilter, ) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('autoFilter',) def __init__(self, fld=None, mpFld=None, type=None, evalOrder=None, id=None, iMeasureHier=None, iMeasureFld=None, name=None, description=None, stringValue1=None, stringValue2=None, autoFilter=None, extLst=None, ): self.fld = fld self.mpFld = mpFld self.type = type self.evalOrder = evalOrder self.id = id self.iMeasureHier = iMeasureHier self.iMeasureFld = iMeasureFld self.name = name self.description = description self.stringValue1 = stringValue1 self.stringValue2 = stringValue2 self.autoFilter = autoFilter self.extLst = extLst
class WebPublishItem(Serialisable): tagname = "webPublishItem" id = Integer() divId = String() sourceType = Set(values=([ 'sheet', 'printArea', 'autoFilter', 'range', 'chart', 'pivotTable', 'query', 'label' ])) sourceRef = String() sourceObject = String(allow_none=True) destinationFile = String() title = String(allow_none=True) autoRepublish = Bool(allow_none=True) def __init__( self, id=None, divId=None, sourceType=None, sourceRef=None, sourceObject=None, destinationFile=None, title=None, autoRepublish=None, ): self.id = id self.divId = divId self.sourceType = sourceType self.sourceRef = sourceRef self.sourceObject = sourceObject self.destinationFile = destinationFile self.title = title self.autoRepublish = autoRepublish
class Side(HashableObject): spec = """Actually to BorderPr 18.8.6""" """Border options for use in styles. Caution: if you do not specify a border_style, other attributes will have no effect !""" __fields__ = ('style', 'color') color = Typed(expected_type=Color, allow_none=True) style = Set(values=(BORDER_NONE, BORDER_DASHDOT, BORDER_DASHDOTDOT, BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM, BORDER_MEDIUMDASHDOT, BORDER_MEDIUMDASHDOTDOT, BORDER_MEDIUMDASHED, BORDER_SLANTDASHDOT, BORDER_THICK, BORDER_THIN)) border_style = Alias('style') def __init__(self, style=None, color=None, border_style=None): if border_style is not None: style = border_style self.style = style self.color = color def __iter__(self): for key in ("style",): value = getattr(self, key) if value: yield key, safe_string(value)
class Shape3D(Serialisable): z = Typed(expected_type=Coordinate, allow_none=True) extrusionH = Typed(expected_type=Integer()) contourW = Typed(expected_type=Integer()) prstMaterial = Typed(expected_type=Set(values=(['legacyMatte', 'legacyPlastic', 'legacyMetal', 'legacyWireframe', 'matte', 'plastic', 'metal', 'warmMatte', 'translucentPowder', 'powder', 'dkEdge', 'softEdge', 'clear', 'flat', 'softmetal']))) bevelT = Typed(expected_type=Bevel, allow_none=True) bevelB = Typed(expected_type=Bevel, allow_none=True) extrusionClr = Typed(expected_type=Color, allow_none=True) contourClr = Typed(expected_type=Color, allow_none=True) extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) def __init__(self, z=None, extrusionH=None, contourW=None, prstMaterial=None, bevelT=None, bevelB=None, extrusionClr=None, contourClr=None, extLst=None, ): self.z = z self.extrusionH = extrusionH self.contourW = contourW self.prstMaterial = prstMaterial self.bevelT = bevelT self.bevelB = bevelB self.extrusionClr = extrusionClr self.contourClr = contourClr self.extLst = extLst
class RangePr(Serialisable): autoStart = Bool() autoEnd = Bool() groupBy = Set(values=(['range', 'seconds', 'minutes', 'hours', 'days', 'months', 'quarters', 'years'])) startNum = Float() endNum = Float() startDate = DateTime() endDate = DateTime() groupInterval = Float() def __init__(self, autoStart=None, autoEnd=None, groupBy=None, startNum=None, endNum=None, startDate=None, endDate=None, groupInterval=None, ): self.autoStart = autoStart self.autoEnd = autoEnd self.groupBy = groupBy self.startNum = startNum self.endNum = endNum self.startDate = startDate self.endDate = endDate self.groupInterval = groupInterval
class DateGroupItem(Serialisable): tagname = "dateGroupItem" year = Integer() month = MinMax(min=1, max=12, allow_none=True) day = MinMax(min=1, max=31, allow_none=True) hour = MinMax(min=0, max=23, allow_none=True) minute = MinMax(min=0, max=59, allow_none=True) second = Integer(min=0, max=59, allow_none=True) dateTimeGrouping = Set( values=(['year', 'month', 'day', 'hour', 'minute', 'second'])) def __init__( self, year=None, month=None, day=None, hour=None, minute=None, second=None, dateTimeGrouping=None, ): self.year = year self.month = month self.day = day self.hour = hour self.minute = minute self.second = second self.dateTimeGrouping = dateTimeGrouping
class RowColItem(Serialisable): tagname = "i" t = Set(values=([ 'data', 'default', 'sum', 'countA', 'avg', 'max', 'min', 'product', 'count', 'stdDev', 'stdDevP', 'var', 'varP', 'grand', 'blank' ])) r = Integer() i = Integer() x = Sequence(expected_type=Index, attribute="v") __elements__ = ('x', ) def __init__( self, t="data", r=0, i=0, x=(), ): self.t = t self.r = r self.i = i self.x = x
class TableStyleElement(Serialisable): tagname = "tableStyleElement" type = Set(values=([ 'wholeTable', 'headerRow', 'totalRow', 'firstColumn', 'lastColumn', 'firstRowStripe', 'secondRowStripe', 'firstColumnStripe', 'secondColumnStripe', 'firstHeaderCell', 'lastHeaderCell', 'firstTotalCell', 'lastTotalCell', 'firstSubtotalColumn', 'secondSubtotalColumn', 'thirdSubtotalColumn', 'firstSubtotalRow', 'secondSubtotalRow', 'thirdSubtotalRow', 'blankRow', 'firstColumnSubheading', 'secondColumnSubheading', 'thirdColumnSubheading', 'firstRowSubheading', 'secondRowSubheading', 'thirdRowSubheading', 'pageFieldLabels', 'pageFieldValues' ])) size = Integer(allow_none=True) dxfId = Integer(allow_none=True) def __init__( self, type=None, size=None, dxfId=None, ): self.type = type self.size = size self.dxfId = dxfId
class CacheSource(Serialisable): tagname = "cacheSource" type = Set(values=(['worksheet', 'external', 'consolidation', 'scenario'])) connectionId = Integer(allow_none=True) # some elements are choice worksheetSource = Typed(expected_type=WorksheetSource, allow_none=True) consolidation = Typed(expected_type=Consolidation, allow_none=True) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ( 'worksheetSource', 'consolidation', ) def __init__( self, type=None, connectionId=None, worksheetSource=None, consolidation=None, extLst=None, ): self.type = type self.connectionId = connectionId self.worksheetSource = worksheetSource self.consolidation = consolidation
class AutonumberBullet(Serialisable): type = Set(values=([ 'alphaLcParenBoth', 'alphaUcParenBoth', 'alphaLcParenR', 'alphaUcParenR', 'alphaLcPeriod', 'alphaUcPeriod', 'arabicParenBoth', 'arabicParenR', 'arabicPeriod', 'arabicPlain', 'romanLcParenBoth', 'romanUcParenBoth', 'romanLcParenR', 'romanUcParenR', 'romanLcPeriod', 'romanUcPeriod', 'circleNumDbPlain', 'circleNumWdBlackPlain', 'circleNumWdWhitePlain', 'arabicDbPeriod', 'arabicDbPlain', 'ea1ChsPeriod', 'ea1ChsPlain', 'ea1ChtPeriod', 'ea1ChtPlain', 'ea1JpnChsDbPeriod', 'ea1JpnKorPlain', 'ea1JpnKorPeriod', 'arabic1Minus', 'arabic2Minus', 'hebrew2Minus', 'thaiAlphaPeriod', 'thaiAlphaParenR', 'thaiAlphaParenBoth', 'thaiNumPeriod', 'thaiNumParenR', 'thaiNumParenBoth', 'hindiAlphaPeriod', 'hindiNumPeriod', 'hindiNumParenR', 'hindiAlpha1Period' ])) startAt = Integer() def __init__( self, type=None, startAt=None, ): self.type = type self.startAt = startAt
class RangePr(Serialisable): tagname = "rangePr" autoStart = Bool(allow_none=True) autoEnd = Bool(allow_none=True) groupBy = Set(values=([ 'range', 'seconds', 'minutes', 'hours', 'days', 'months', 'quarters', 'years' ])) startNum = Float(allow_none=True) endNum = Float(allow_none=True) startDate = DateTime(allow_none=True) endDate = DateTime(allow_none=True) groupInterval = Float(allow_none=True) def __init__( self, autoStart=True, autoEnd=True, groupBy=range, startNum=None, endNum=None, startDate=None, endDate=None, groupInterval=1, ): self.autoStart = autoStart self.autoEnd = autoEnd self.groupBy = groupBy self.startNum = startNum self.endNum = endNum self.startDate = startDate self.endDate = endDate self.groupInterval = groupInterval
class PresetShadowEffect(ColorChoice): prst = Set(values=(['shdw1', 'shdw2', 'shdw3', 'shdw4', 'shdw5', 'shdw6', 'shdw7', 'shdw8', 'shdw9', 'shdw10', 'shdw11', 'shdw12', 'shdw13', 'shdw14', 'shdw15', 'shdw16', 'shdw17', 'shdw18', 'shdw19', 'shdw20'])) dist = Float() dir = Integer() # uses element group EG_ColorChoice scrgbClr = ColorChoice.scrgbClr srgbClr = ColorChoice.srgbClr hslClr = ColorChoice.hslClr sysClr = ColorChoice.sysClr schemeClr = ColorChoice.schemeClr prstClr = ColorChoice.prstClr __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr') def __init__(self, prst=None, dist=None, dir=None, **kw ): self.prst = prst self.dist = dist self.dir = dir super(PresetShadowEffect, self).__init__(**kw)
class GradientFill(Fill): tagname = "gradientFill" __fields__ = ('type', 'degree', 'left', 'right', 'top', 'bottom', 'stop') type = Set(values=('linear', 'path')) fill_type = Alias("type") degree = Float() left = Float() right = Float() top = Float() bottom = Float() stop = Sequence(expected_type=Color, nested=True) def __init__(self, type="linear", degree=0, left=0, right=0, top=0, bottom=0, stop=(), fill_type=None): self.degree = degree self.left = left self.right = right self.top = top self.bottom = bottom self.stop = stop if fill_type is not None: type = fill_type self.type = type def __iter__(self): for attr in self.__attrs__: value = getattr(self, attr) if value: yield attr, safe_string(value) @classmethod def _from_tree(cls, node): colors = [] for color in safe_iterator(node, "{%s}color" % SHEET_MAIN_NS): colors.append(Color.from_tree(color)) return cls(stop=colors, **node.attrib) def _serialise_nested(self, sequence): """ Colors need special handling """ for idx, color in enumerate(sequence): stop = Element("stop", position=str(idx)) stop.append(color.to_tree()) yield stop def to_tree(self, tagname=None): parent = Element("fill") el = super(GradientFill, self).to_tree() parent.append(el) return parent
class PatternFill(Fill): """Area fill patterns for use in styles. Caution: if you do not specify a fill_type, other attributes will have no effect !""" spec = """18.8.32""" __fields__ = ('patternType', 'fgColor', 'bgColor') patternType = Set(values=fills) fill_type = Alias("patternType") fgColor = Typed(expected_type=Color) start_color = Alias("fgColor") bgColor = Typed(expected_type=Color) end_color = Alias("bgColor") def __init__(self, patternType=FILL_NONE, fgColor=Color(), bgColor=Color(), fill_type=None, start_color=None, end_color=None): if fill_type is not None: patternType = fill_type self.patternType = patternType if start_color is not None: fgColor = start_color self.fgColor = fgColor if end_color is not None: bgColor = end_color self.bgColor = bgColor
class ConditionalFormat(Serialisable): tagname = "conditionalFormat" scope = Set(values=(['selection', 'data', 'field'])) type = NoneSet(values=(['all', 'row', 'column'])) priority = Integer() pivotAreas = NestedSequence(expected_type=PivotArea) extLst = Typed(expected_type=ExtensionList, allow_none=True) __elements__ = ('pivotAreas', ) def __init__( self, scope=None, type=None, priority=None, pivotAreas=(), extLst=None, ): self.scope = scope self.type = type self.priority = priority self.pivotAreas = pivotAreas self.extLst = extLst
class CustomChartsheetView(Serialisable): tagname = "customSheetView" guid = Guid() scale = Integer() state = Set(values=(['visible', 'hidden', 'veryHidden'])) zoomToFit = Bool(allow_none=True) pageMargins = Typed(expected_type=PageMargins, allow_none=True) pageSetup = Typed(expected_type=PrintPageSetup, allow_none=True) headerFooter = Typed(expected_type=HeaderFooter, allow_none=True) __elements__ = ('pageMargins', 'pageSetup', 'headerFooter') def __init__( self, guid=None, scale=None, state='visible', zoomToFit=None, pageMargins=None, pageSetup=None, headerFooter=None, ): self.guid = guid self.scale = scale self.state = state self.zoomToFit = zoomToFit self.pageMargins = pageMargins self.pageSetup = pageSetup self.headerFooter = headerFooter
class PresetGeometry2D(Serialisable): prst = Set(values=( ['line', 'lineInv', 'triangle', 'rtTriangle', 'rect', 'diamond', 'parallelogram', 'trapezoid', 'nonIsoscelesTrapezoid', 'pentagon', 'hexagon', 'heptagon', 'octagon', 'decagon', 'dodecagon', 'star4', 'star5', 'star6', 'star7', 'star8', 'star10', 'star12', 'star16', 'star24', 'star32', 'roundRect', 'round1Rect', 'round2SameRect', 'round2DiagRect', 'snipRoundRect', 'snip1Rect', 'snip2SameRect', 'snip2DiagRect', 'plaque', 'ellipse', 'teardrop', 'homePlate', 'chevron', 'pieWedge', 'pie', 'blockArc', 'donut', 'noSmoking', 'rightArrow', 'leftArrow', 'upArrow', 'downArrow', 'stripedRightArrow', 'notchedRightArrow', 'bentUpArrow', 'leftRightArrow', 'upDownArrow', 'leftUpArrow', 'leftRightUpArrow', 'quadArrow', 'leftArrowCallout', 'rightArrowCallout', 'upArrowCallout', 'downArrowCallout', 'leftRightArrowCallout', 'upDownArrowCallout', 'quadArrowCallout', 'bentArrow', 'uturnArrow', 'circularArrow', 'leftCircularArrow', 'leftRightCircularArrow', 'curvedRightArrow', 'curvedLeftArrow', 'curvedUpArrow', 'curvedDownArrow', 'swooshArrow', 'cube', 'can', 'lightningBolt', 'heart', 'sun', 'moon', 'smileyFace', 'irregularSeal1', 'irregularSeal2', 'foldedCorner', 'bevel', 'frame', 'halfFrame', 'corner', 'diagStripe', 'chord', 'arc', 'leftBracket', 'rightBracket', 'leftBrace', 'rightBrace', 'bracketPair', 'bracePair', 'straightConnector1', 'bentConnector2', 'bentConnector3', 'bentConnector4', 'bentConnector5', 'curvedConnector2', 'curvedConnector3', 'curvedConnector4', 'curvedConnector5', 'callout1', 'callout2', 'callout3', 'accentCallout1', 'accentCallout2', 'accentCallout3', 'borderCallout1', 'borderCallout2', 'borderCallout3', 'accentBorderCallout1', 'accentBorderCallout2', 'accentBorderCallout3', 'wedgeRectCallout', 'wedgeRoundRectCallout', 'wedgeEllipseCallout', 'cloudCallout', 'cloud', 'ribbon', 'ribbon2', 'ellipseRibbon', 'ellipseRibbon2', 'leftRightRibbon', 'verticalScroll', 'horizontalScroll', 'wave', 'doubleWave', 'plus', 'flowChartProcess', 'flowChartDecision', 'flowChartInputOutput', 'flowChartPredefinedProcess', 'flowChartInternalStorage', 'flowChartDocument', 'flowChartMultidocument', 'flowChartTerminator', 'flowChartPreparation', 'flowChartManualInput', 'flowChartManualOperation', 'flowChartConnector', 'flowChartPunchedCard', 'flowChartPunchedTape', 'flowChartSummingJunction', 'flowChartOr', 'flowChartCollate', 'flowChartSort', 'flowChartExtract', 'flowChartMerge', 'flowChartOfflineStorage', 'flowChartOnlineStorage', 'flowChartMagneticTape', 'flowChartMagneticDisk', 'flowChartMagneticDrum', 'flowChartDisplay', 'flowChartDelay', 'flowChartAlternateProcess', 'flowChartOffpageConnector', 'actionButtonBlank', 'actionButtonHome', 'actionButtonHelp', 'actionButtonInformation', 'actionButtonForwardNext', 'actionButtonBackPrevious', 'actionButtonEnd', 'actionButtonBeginning', 'actionButtonReturn', 'actionButtonDocument', 'actionButtonSound', 'actionButtonMovie', 'gear6', 'gear9', 'funnel', 'mathPlus', 'mathMinus', 'mathMultiply', 'mathDivide', 'mathEqual', 'mathNotEqual', 'cornerTabs', 'squareTabs', 'plaqueTabs', 'chartX', 'chartStar', 'chartPlus'])) avLst = Typed(expected_type=GeomGuideList, allow_none=True) def __init__(self, prst=None, avLst=None, ): self.prst = prst self.avLst = avLst
class PhoneticProperties(Serialisable): fontId = Integer() type = Set(values=( ['halfwidthKatakana', 'fullwidthKatakana', 'Hiragana', 'noConversion'] )) alignment = Set(values=(['noControl', 'left', 'center', 'distributed'])) def __init__( self, fontId=None, type=None, alignment=None, ): self.fontId = fontId self.type = type self.alignment = alignment
class FillOverlayEffect(Serialisable): blend = Set(values=(['over', 'mult', 'screen', 'darken', 'lighten'])) def __init__(self, blend=None, ): self.blend = blend
class Pane(Serialisable): xSplit = Float(allow_none=True) ySplit = Float(allow_none=True) topLeftCell = String(allow_none=True) activePane = Set(values=("bottomRight", "topRight", "bottomLeft", "topLeft")) state = Set(values=("split", "frozen", "frozenSplit")) def __init__(self, xSplit=None, ySplit=None, topLeftCell=None, activePane="topLeft", state="split"): self.xSplit = xSplit self.ySplit = ySplit self.topLeftCell = topLeftCell self.activePane = activePane self.state = state
class GradientFill(Fill): """Fill areas with gradient Two types of gradient fill are supported: - A type='linear' gradient interpolates colours between a set of specified Stops, across the length of an area. The gradient is left-to-right by default, but this orientation can be modified with the degree attribute. A list of Colors can be provided instead and they will be positioned with equal distance between them. - A type='path' gradient applies a linear gradient from each edge of the area. Attributes top, right, bottom, left specify the extent of fill from the respective borders. Thus top="0.2" will fill the top 20% of the cell. """ tagname = "gradientFill" type = Set(values=('linear', 'path')) fill_type = Alias("type") degree = Float() left = Float() right = Float() top = Float() bottom = Float() stop = StopList() def __init__(self, type="linear", degree=0, left=0, right=0, top=0, bottom=0, stop=()): self.degree = degree self.left = left self.right = right self.top = top self.bottom = bottom self.stop = stop self.type = type def __iter__(self): for attr in self.__attrs__: value = getattr(self, attr) if value: yield attr, safe_string(value) def to_tree(self, tagname=None, namespace=None, idx=None): parent = Element("fill") el = super(GradientFill, self).to_tree() parent.append(el) return parent
class LightRig(Serialisable): rig = Typed(expected_type=Set(values=(['legacyFlat1', 'legacyFlat2', 'legacyFlat3', 'legacyFlat4', 'legacyNormal1', 'legacyNormal2', 'legacyNormal3', 'legacyNormal4', 'legacyHarsh1', 'legacyHarsh2', 'legacyHarsh3', 'legacyHarsh4', 'threePt', 'balanced', 'soft', 'harsh', 'flood', 'contrasting', 'morning', 'sunrise', 'sunset', 'chilly', 'freezing', 'flat', 'twoPt', 'glow', 'brightRoom']))) dir = Typed(expected_type=Set(values=(['tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br']))) rot = Typed(expected_type=SphereCoords, allow_none=True) def __init__(self, rig=None, dir=None, rot=None, ): self.rig = rig self.dir = dir self.rot = rot
class TabStop(Serialisable): pos = Typed(expected_type=Coordinate, allow_none=True) algn = Typed(expected_type=Set(values=(['l', 'ctr', 'r', 'dec']))) def __init__(self, pos=None, algn=None, ): self.pos = pos self.algn = algn
class EffectContainer(Serialisable): type = Set(values=(['sib', 'tree'])) name = String(allow_none=True) def __init__(self, type=None, name=None, ): self.type = type self.name = name
class PathShadeProperties(Serialisable): path = Set(values=(['shape', 'circle', 'rect'])) fillToRect = Typed(expected_type=RelativeRect, allow_none=True) def __init__(self, path=None, fillToRect=None, ): self.path = path self.fillToRect = fillToRect