Example #1
0
class Index(Serialisable):

    tagname = "x"

    v = Integer(allow_none=True)

    def __init__(
        self,
        v=0,
    ):
        self.v = v
Example #2
0
class NumberFormat(Serialisable):

    numFmtId = Integer()
    formatCode = String()

    def __init__(
        self,
        numFmtId=None,
        formatCode=None,
    ):
        self.numFmtId = numFmtId
        self.formatCode = formatCode
Example #3
0
class LineJoinMiterProperties(Serialisable):

    tagname = "miter"
    namespace = DRAWING_NS

    lim = Integer(allow_none=True)

    def __init__(
        self,
        lim=None,
    ):
        self.lim = lim
Example #4
0
class LinearShadeProperties(Serialisable):

    ang = Integer()
    scaled = Bool(allow_none=True)

    def __init__(
        self,
        ang=None,
        scaled=None,
    ):
        self.ang = ang
        self.scaled = scaled
Example #5
0
class DataField(Serialisable):

    tagname = "dataField"

    name = String(allow_none=True)
    fld = Integer()
    subtotal = Set(values=([
        'average', 'count', 'countNums', 'max', 'min', 'product', 'stdDev',
        'stdDevp', 'sum', 'var', 'varp'
    ]))
    showDataAs = Set(values=([
        'normal', 'difference', 'percent', 'percentDiff', 'runTotal',
        'percentOfRow', 'percentOfCol', 'percentOfTotal', 'index'
    ]))
    baseField = Integer()
    baseItem = Integer()
    numFmtId = Integer(allow_none=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ()

    def __init__(
        self,
        name=None,
        fld=None,
        subtotal="sum",
        showDataAs="normal",
        baseField=-1,
        baseItem=1048832,
        numFmtId=None,
        extLst=None,
    ):
        self.name = name
        self.fld = fld
        self.subtotal = subtotal
        self.showDataAs = showDataAs
        self.baseField = baseField
        self.baseItem = baseItem
        self.numFmtId = numFmtId
        self.extLst = extLst
Example #6
0
class PivotFilters(Serialisable):

    count = Integer()
    filter = Typed(expected_type=PivotFilter, allow_none=True)

    __elements__ = ('filter', )

    def __init__(
        self,
        count=None,
        filter=None,
    ):
        self.filter = filter
Example #7
0
class FieldsUsage(Serialisable):

    count = Integer()
    fieldUsage = Typed(expected_type=FieldUsage, allow_none=True)

    __elements__ = ('fieldUsage',)

    def __init__(self,
                 count=None,
                 fieldUsage=None,
                ):
        self.count = count
        self.fieldUsage = fieldUsage
Example #8
0
class GroupLevels(Serialisable):

    count = Integer()
    groupLevel = Typed(expected_type=GroupLevel, )

    __elements__ = ('groupLevel',)

    def __init__(self,
                 count=None,
                 groupLevel=None,
                ):
        self.count = count
        self.groupLevel = groupLevel
Example #9
0
class GroupMembers(Serialisable):

    count = Integer()
    groupMember = Typed(expected_type=GroupMember, )

    __elements__ = ('groupMember',)

    def __init__(self,
                 count=None,
                 groupMember=None,
                ):
        self.count = count
        self.groupMember = groupMember
Example #10
0
class OLAPSets(Serialisable):

    count = Integer()
    set = Typed(expected_type=OLAPSet, )

    __elements__ = ('set',)

    def __init__(self,
                 count=None,
                 set=None,
                ):
        self.count = count
        self.set = set
Example #11
0
class ChartsheetView(Serialisable):
    tagname = "sheetView"

    tabSelected = Bool(allow_none=True)
    zoomScale = Integer(allow_none=True)
    workbookViewId = Integer()
    zoomToFit = Bool(allow_none=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ()

    def __init__(self,
                 tabSelected=None,
                 zoomScale=None,
                 workbookViewId=0,
                 zoomToFit=None,
                 extLst=None,
                 ):
        self.tabSelected = tabSelected
        self.zoomScale = zoomScale
        self.workbookViewId = workbookViewId
        self.zoomToFit = zoomToFit
Example #12
0
class ColorFilter(Serialisable):

    tagname = "colorFilter"

    dxfId = Integer(allow_none=True)
    cellColor = Bool(allow_none=True)

    def __init__(self,
                 dxfId=None,
                 cellColor=None,
                ):
        self.dxfId = dxfId
        self.cellColor = cellColor
Example #13
0
class ChartFormat(Serialisable):

    tagname = "chartFormat"

    chart = Integer()
    format = Integer()
    series = Bool()
    pivotArea = Typed(expected_type=PivotArea, )

    __elements__ = ('pivotArea', )

    def __init__(
        self,
        chart=None,
        format=None,
        series=None,
        pivotArea=None,
    ):
        self.chart = chart
        self.format = format
        self.series = series
        self.pivotArea = pivotArea
Example #14
0
class ServerFormats(Serialisable):

    count = Integer()
    serverFormat = Typed(expected_type=ServerFormat, allow_none=True)

    __elements__ = ('serverFormat',)

    def __init__(self,
                 count=None,
                 serverFormat=None,
                ):
        self.count = count
        self.serverFormat = serverFormat
Example #15
0
class _NamedCellStyleList(Serialisable):
    """
    Container for named cell style objects

    Not used in client code
    """

    tagname = "cellStyles"

    count = Integer(allow_none=True)
    cellStyle = Sequence(expected_type=_NamedCellStyle)

    __attrs__ = ("count", )

    def __init__(
            self,
            count=None,
            cellStyle=(),
    ):
        self.cellStyle = cellStyle

    @property
    def count(self):
        return len(self.cellStyle)

    @property
    def names(self):
        """
        Convert to NamedStyle objects and remove duplicates.

        In theory the highest xfId wins but in practice they are duplicates
        so it doesn't matter.
        """
        def sort_fn(v):
            return v.xfId

        styles = []
        names = set()

        for ns in sorted(self.cellStyle, key=sort_fn):
            if ns.name in names:
                continue

            style = NamedStyle(name=ns.name,
                               hidden=ns.hidden,
                               builtinId=ns.builtinId)
            names.add(ns.name)
            style._set_index(len(styles))  # assign xfId
            styles.append(style)

        return NamedStyleList(styles)
Example #16
0
class WebPublishing(Serialisable):

    tagname = "webPublishing"

    css = Bool(allow_none=True)
    thicket = Bool(allow_none=True)
    longFileNames = Bool(allow_none=True)
    vml = Bool(allow_none=True)
    allowPng = Bool(allow_none=True)
    targetScreenSize = NoneSet(values=([
        '544x376', '640x480', '720x512', '800x600', '1024x768', '1152x882',
        '1152x900', '1280x1024', '1600x1200', '1800x1440', '1920x1200'
    ]))
    dpi = Integer(allow_none=True)
    codePage = Integer(allow_none=True)
    characterSet = String(allow_none=True)

    def __init__(
        self,
        css=None,
        thicket=None,
        longFileNames=None,
        vml=None,
        allowPng=None,
        targetScreenSize='800x600',
        dpi=None,
        codePage=None,
        characterSet=None,
    ):
        self.css = css
        self.thicket = thicket
        self.longFileNames = longFileNames
        self.vml = vml
        self.allowPng = allowPng
        self.targetScreenSize = targetScreenSize
        self.dpi = dpi
        self.codePage = codePage
        self.characterSet = characterSet
Example #17
0
class TupleList(Serialisable):

    c = Integer(allow_none=True)
    tpl = Typed(expected_type=Tuple, )

    __elements__ = ('tpl', )

    def __init__(
        self,
        c=None,
        tpl=None,
    ):
        self.c = c
        self.tpl = tpl
Example #18
0
class Break(Serialisable):

    tagname = "brk"

    id = Integer(allow_none=True)
    min = Integer(allow_none=True)
    max = Integer(allow_none=True)
    man = Bool(allow_none=True)
    pt = Bool(allow_none=True)

    def __init__(
        self,
        id=0,
        min=0,
        max=16383,
        man=True,
        pt=None,
    ):
        self.id = id
        self.min = min
        self.max = max
        self.man = man
        self.pt = pt
Example #19
0
class DataBar(RuleType):

    tagname = "dataBar"

    minLength = Integer(allow_none=True)
    maxLength = Integer(allow_none=True)
    showValue = Bool(allow_none=True)
    color = ColorDescriptor()

    __elements__ = ('cfvo', 'color')

    def __init__(self,
                 minLength=None,
                 maxLength=None,
                 showValue=None,
                 cfvo=None,
                 color=None,
                ):
        self.minLength = minLength
        self.maxLength = maxLength
        self.showValue = showValue
        self.cfvo = cfvo
        self.color = color
Example #20
0
class ExternalRow(Serialisable):

    r = Integer()
    cell = Sequence(expected_type=ExternalCell)

    __elements__ = ('cell', )

    def __init__(
            self,
            r=(),
            cell=None,
    ):
        self.r = r
        self.cell = cell
Example #21
0
class StrVal(Serialisable):

    tagname = "strVal"

    idx = Integer()
    v = NestedText(expected_type=unicode)

    def __init__(
        self,
        idx=0,
        v=None,
    ):
        self.idx = idx
        self.v = v
Example #22
0
class Shape3D(Serialisable):

    z = Typed(expected_type=Coordinate, allow_none=True)
    extrusionH = Integer(allow_none=True)
    contourW = Integer(allow_none=True)
    prstMaterial = NoneSet(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
Example #23
0
class FilterColumn(Serialisable):

    tagname = "filterColumn"

    colId = Integer()
    col_id = Alias('colId')
    hiddenButton = Bool(allow_none=True)
    showButton = Bool(allow_none=True)
    # some elements are choice
    filters = Typed(expected_type=Filters, allow_none=True)
    top10 = Typed(expected_type=Top10, allow_none=True)
    customFilters = Typed(expected_type=CustomFilters, allow_none=True)
    dynamicFilter = Typed(expected_type=DynamicFilter, allow_none=True)
    colorFilter = Typed(expected_type=ColorFilter, allow_none=True)
    iconFilter = Typed(expected_type=IconFilter, allow_none=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ('filters', 'top10', 'customFilters', 'dynamicFilter',
                    'colorFilter', 'iconFilter')

    def __init__(self,
                 colId=None,
                 hiddenButton=None,
                 showButton=None,
                 filters=None,
                 top10=None,
                 customFilters=None,
                 dynamicFilter=None,
                 colorFilter=None,
                 iconFilter=None,
                 extLst=None,
                 blank=None,
                 vals=None,
                ):
        self.colId = colId
        self.hiddenButton = hiddenButton
        self.showButton = showButton
        if filters is None:
            filters = Filters()
        self.filters = filters
        self.top10 = top10
        self.customFilters = customFilters
        self.dynamicFilter = dynamicFilter
        self.colorFilter = colorFilter
        self.iconFilter = iconFilter
        if blank is not None:
            self.filters.blank = blank
        if vals is not None:
            self.filters.filter = vals
Example #24
0
class BookView(Serialisable):

    tagname = "workbookView"

    visibility = NoneSet(values=(['visible', 'hidden', 'veryHidden']))
    minimized = Bool(allow_none=True)
    showHorizontalScroll = Bool(allow_none=True)
    showVerticalScroll = Bool(allow_none=True)
    showSheetTabs = Bool(allow_none=True)
    xWindow = Integer(allow_none=True)
    yWindow = Integer(allow_none=True)
    windowWidth = Integer(allow_none=True)
    windowHeight = Integer(allow_none=True)
    tabRatio = Integer(allow_none=True)
    firstSheet = Integer(allow_none=True)
    activeTab = Integer(allow_none=True)
    autoFilterDateGrouping = Bool(allow_none=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ()

    def __init__(
        self,
        visibility=None,
        minimized=None,
        showHorizontalScroll=None,
        showVerticalScroll=None,
        showSheetTabs=None,
        xWindow=None,
        yWindow=None,
        windowWidth=None,
        windowHeight=None,
        tabRatio=None,
        firstSheet=None,
        activeTab=None,
        autoFilterDateGrouping=None,
        extLst=None,
    ):
        self.visibility = visibility
        self.minimized = minimized
        self.showHorizontalScroll = showHorizontalScroll
        self.showVerticalScroll = showVerticalScroll
        self.showSheetTabs = showSheetTabs
        self.xWindow = xWindow
        self.yWindow = yWindow
        self.windowWidth = windowWidth
        self.windowHeight = windowHeight
        self.tabRatio = tabRatio
        self.firstSheet = firstSheet
        self.activeTab = activeTab
        self.autoFilterDateGrouping = autoFilterDateGrouping
Example #25
0
class Groups(Serialisable):

    tagname = "groups"

    count = Integer()
    group = Typed(expected_type=LevelGroup, )

    __elements__ = ('group',)

    def __init__(self,
                 count=None,
                 group=None,
                ):
        self.count = count
        self.group = group
Example #26
0
class DiscretePr(Serialisable):

    tagname = "discretePr"

    count = Integer()
    x = NestedInteger(allow_none=True)

    __elements__ = ('x',)

    def __init__(self,
                 count=None,
                 x=None,
                ):
        self.count = count
        self.x = x
Example #27
0
class NumVal(Serialisable):

    idx = Integer()
    formatCode = NestedText(allow_none=True, expected_type=unicode)
    v = NumberValueDescriptor()

    def __init__(
        self,
        idx=None,
        formatCode=None,
        v=None,
    ):
        self.idx = idx
        self.formatCode = formatCode
        self.v = v
Example #28
0
class FieldGroup(Serialisable):

    tagname = "fieldGroup"

    par = Integer(allow_none=True)
    base = Integer(allow_none=True)
    rangePr = Typed(expected_type=RangePr, allow_none=True)
    discretePr = Typed(expected_type=DiscretePr, allow_none=True)
    groupItems = Typed(expected_type=GroupItems, allow_none=True)

    __elements__ = ('rangePr', 'discretePr', 'groupItems')

    def __init__(self,
                 par=None,
                 base=None,
                 rangePr=None,
                 discretePr=None,
                 groupItems=None,
                ):
        self.par = par
        self.base = base
        self.rangePr = rangePr
        self.discretePr = discretePr
        self.groupItems = groupItems
Example #29
0
class WebPublishItems(Serialisable):
    tagname = "WebPublishItems"

    count = Integer(allow_none=True)
    webPublishItem = Sequence(expected_type=WebPublishItem, )

    __elements__ = ('webPublishItem', )

    def __init__(
        self,
        count=None,
        webPublishItem=None,
    ):
        self.count = len(webPublishItem)
        self.webPublishItem = webPublishItem
Example #30
0
class _NamedCellStyle(Serialisable):
    """
    Pointer-based representation of named styles in XML
    xfId refers to the corresponding CellStyleXfs

    Not used in client code.
    """

    tagname = "cellStyle"

    name = String()
    xfId = Integer()
    builtinId = Integer(allow_none=True)
    iLevel = Integer(allow_none=True)
    hidden = Bool(allow_none=True)
    customBuiltin = Bool(allow_none=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ()

    def __init__(
        self,
        name=None,
        xfId=None,
        builtinId=None,
        iLevel=None,
        hidden=None,
        customBuiltin=None,
        extLst=None,
    ):
        self.name = name
        self.xfId = xfId
        self.builtinId = builtinId
        self.iLevel = iLevel
        self.hidden = hidden
        self.customBuiltin = customBuiltin