Ejemplo n.º 1
0
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 = NestedInteger(allow_none=True, attribute="v")

    __elements__ = ('x', )

    def __init__(
        self,
        t="data",
        r=0,
        i=0,
        x=None,
    ):
        self.t = t
        self.r = r
        self.i = i
        self.x = x
Ejemplo n.º 2
0
class SheetFormatProperties(Serialisable):

    tagname = "sheetFormatPr"

    baseColWidth = Integer(allow_none=True)
    defaultColWidth = Float(allow_none=True)
    defaultRowHeight = Float()
    customHeight = Bool(allow_none=True)
    zeroHeight = Bool(allow_none=True)
    thickTop = Bool(allow_none=True)
    thickBottom = Bool(allow_none=True)
    outlineLevelRow = Integer(allow_none=True)
    outlineLevelCol = Integer(allow_none=True)

    def __init__(
        self,
        baseColWidth=8,  #according to spec
        defaultColWidth=None,
        defaultRowHeight=15,
        customHeight=None,
        zeroHeight=None,
        thickTop=None,
        thickBottom=None,
        outlineLevelRow=None,
        outlineLevelCol=None,
    ):
        self.baseColWidth = baseColWidth
        self.defaultColWidth = defaultColWidth
        self.defaultRowHeight = defaultRowHeight
        self.customHeight = customHeight
        self.zeroHeight = zeroHeight
        self.thickTop = thickTop
        self.thickBottom = thickBottom
        self.outlineLevelRow = outlineLevelRow
        self.outlineLevelCol = outlineLevelCol
Ejemplo n.º 3
0
class MemberProperty(Serialisable):

    tagname = "mps"

    name = String(allow_none=True)
    showCell = Bool(allow_none=True)
    showTip = Bool(allow_none=True)
    showAsCaption = Bool(allow_none=True)
    nameLen = Integer(allow_none=True)
    pPos = Integer(allow_none=True)
    pLen = Integer(allow_none=True)
    level = Integer(allow_none=True)
    field = Integer()

    def __init__(
        self,
        name=None,
        showCell=None,
        showTip=None,
        showAsCaption=None,
        nameLen=None,
        pPos=None,
        pLen=None,
        level=None,
        field=None,
    ):
        self.name = name
        self.showCell = showCell
        self.showTip = showTip
        self.showAsCaption = showAsCaption
        self.nameLen = nameLen
        self.pPos = pPos
        self.pLen = pLen
        self.level = level
        self.field = field
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
class SortCondition(Serialisable):

    tagname = "sortCondition"

    descending = Bool(allow_none=True)
    sortBy = NoneSet(values=(['value', 'cellColor', 'fontColor', 'icon']))
    ref = CellRange()
    customList = String(allow_none=True)
    dxfId = Integer(allow_none=True)
    iconSet = NoneSet(values=([
        '3Arrows', '3ArrowsGray', '3Flags', '3TrafficLights1',
        '3TrafficLights2', '3Signs', '3Symbols', '3Symbols2', '4Arrows',
        '4ArrowsGray', '4RedToBlack', '4Rating', '4TrafficLights', '5Arrows',
        '5ArrowsGray', '5Rating', '5Quarters'
    ]))
    iconId = Integer(allow_none=True)

    def __init__(
        self,
        ref=None,
        descending=None,
        sortBy=None,
        customList=None,
        dxfId=None,
        iconSet=None,
        iconId=None,
    ):
        self.descending = descending
        self.sortBy = sortBy
        self.ref = ref
        self.customList = customList
        self.dxfId = dxfId
        self.iconSet = iconSet
        self.iconId = iconId
Ejemplo n.º 7
0
class OLAPSet(Serialisable):

    tagname = "set"

    count = Integer()
    maxRank = Integer()
    setDefinition = String()
    sortType = NoneSet(values=([
        'ascending', 'descending', 'ascendingAlpha', 'descendingAlpha',
        'ascendingNatural', 'descendingNatural'
    ]))
    queryFailed = Bool()
    tpls = Typed(expected_type=TupleList, allow_none=True)
    sortByTuple = Typed(expected_type=TupleList, allow_none=True)

    __elements__ = ('tpls', 'sortByTuple')

    def __init__(
        self,
        count=None,
        maxRank=None,
        setDefinition=None,
        sortType=None,
        queryFailed=None,
        tpls=None,
        sortByTuple=None,
    ):
        self.count = count
        self.maxRank = maxRank
        self.setDefinition = setDefinition
        self.sortType = sortType
        self.queryFailed = queryFailed
        self.tpls = tpls
        self.sortByTuple = sortByTuple
Ejemplo n.º 8
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
Ejemplo n.º 9
0
class RangeSet(Serialisable):

    tagname = "rangeSet"

    i1 = Integer(allow_none=True)
    i2 = Integer(allow_none=True)
    i3 = Integer(allow_none=True)
    i4 = Integer(allow_none=True)
    ref = String()
    name = String(allow_none=True)
    sheet = String(allow_none=True)

    def __init__(
        self,
        i1=None,
        i2=None,
        i3=None,
        i4=None,
        ref=None,
        name=None,
        sheet=None,
    ):
        self.i1 = i1
        self.i2 = i2
        self.i3 = i3
        self.i4 = i4
        self.ref = ref
        self.name = name
        self.sheet = sheet
Ejemplo n.º 10
0
class PageField(Serialisable):

    tagname = "pageField"

    fld = Integer()
    item = Integer(allow_none=True)
    hier = Integer()
    name = String(allow_none=True)
    cap = String(allow_none=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ()

    def __init__(
        self,
        fld=None,
        item=None,
        hier=None,
        name=None,
        cap=None,
        extLst=None,
    ):
        self.fld = fld
        self.item = item
        self.hier = hier
        self.name = name
        self.cap = cap
        self.extLst = extLst
Ejemplo n.º 11
0
class Location(Serialisable):

    tagname = "location"

    ref = String()
    firstHeaderRow = Integer()
    firstDataRow = Integer()
    firstDataCol = Integer()
    rowPageCount = Integer(allow_none=True)
    colPageCount = Integer(allow_none=True)

    def __init__(
        self,
        ref=None,
        firstHeaderRow=None,
        firstDataRow=None,
        firstDataCol=None,
        rowPageCount=None,
        colPageCount=None,
    ):
        self.ref = ref
        self.firstHeaderRow = firstHeaderRow
        self.firstDataRow = firstDataRow
        self.firstDataCol = firstDataCol
        self.rowPageCount = rowPageCount
        self.colPageCount = colPageCount
Ejemplo n.º 12
0
class CommentRecord(Serialisable):

    tagname = "comment"

    ref = String()
    authorId = Integer()
    guid = Guid(allow_none=True)
    shapeId = Integer(allow_none=True)
    text = Typed(expected_type=Text)
    commentPr = Typed(expected_type=Properties, allow_none=True)
    author = String(allow_none=True)

    __elements__ = ('text', 'commentPr')
    __attrs__ = ('ref', 'authorId', 'guid', 'shapeId')

    def __init__(self,
                 ref="",
                 authorId=0,
                 guid=None,
                 shapeId=0,
                 text=None,
                 commentPr=None,
                 author=None,
                 height=79,
                 width=144):
        self.ref = ref
        self.authorId = authorId
        self.guid = guid
        self.shapeId = shapeId
        if text is None:
            text = Text()
        self.text = text
        self.commentPr = commentPr
        self.author = author
        self.height = height
        self.width = width

    @classmethod
    def from_cell(cls, cell):
        """
        Class method to convert cell comment
        """
        comment = cell._comment
        ref = cell.coordinate
        self = cls(ref=ref, author=comment.author)
        self.text.t = comment.content
        self.height = comment.height
        self.width = comment.width
        return self

    @property
    def content(self):
        """
        Remove all inline formatting and stuff
        """
        return self.text.content
Ejemplo n.º 13
0
class Connection(Serialisable):

    id = Integer()
    idx = Integer()

    def __init__(self,
                 id=None,
                 idx=None,
                ):
        self.id = id
        self.idx = idx
Ejemplo n.º 14
0
class TintEffect(Serialisable):

    hue = Integer()
    amt = Integer()

    def __init__(self,
                 hue=None,
                 amt=None,
                ):
        self.hue = hue
        self.amt = amt
Ejemplo n.º 15
0
class LuminanceEffect(Serialisable):

    bright = Integer()
    contrast = Integer()

    def __init__(self,
                 bright=None,
                 contrast=None,
                ):
        self.bright = bright
        self.contrast = contrast
Ejemplo n.º 16
0
class TextNormalAutofit(Serialisable):

    fontScale = Integer()
    lnSpcReduction = Integer()

    def __init__(
        self,
        fontScale=None,
        lnSpcReduction=None,
    ):
        self.fontScale = fontScale
        self.lnSpcReduction = lnSpcReduction
Ejemplo n.º 17
0
class PivotArea(Serialisable):

    tagname = "pivotArea"

    references = NestedSequence(expected_type=Reference, count=True)
    extLst = Typed(expected_type=ExtensionList, allow_none=True)
    field = Integer(allow_none=True)
    type = NoneSet(values=(
        ['normal', 'data', 'all', 'origin', 'button', 'topEnd', 'topRight']))
    dataOnly = Bool(allow_none=True)
    labelOnly = Bool(allow_none=True)
    grandRow = Bool(allow_none=True)
    grandCol = Bool(allow_none=True)
    cacheIndex = Bool(allow_none=True)
    outline = Bool(allow_none=True)
    offset = String(allow_none=True)
    collapsedLevelsAreSubtotals = Bool(allow_none=True)
    axis = NoneSet(values=(['axisRow', 'axisCol', 'axisPage', 'axisValues']))
    fieldPosition = Integer(allow_none=True)

    __elements__ = ('references', )

    def __init__(
        self,
        references=(),
        extLst=None,
        field=None,
        type="normal",
        dataOnly=True,
        labelOnly=None,
        grandRow=None,
        grandCol=None,
        cacheIndex=None,
        outline=True,
        offset=None,
        collapsedLevelsAreSubtotals=None,
        axis=None,
        fieldPosition=None,
    ):
        self.references = references
        self.extLst = extLst
        self.field = field
        self.type = type
        self.dataOnly = dataOnly
        self.labelOnly = labelOnly
        self.grandRow = grandRow
        self.grandCol = grandCol
        self.cacheIndex = cacheIndex
        self.outline = outline
        self.offset = offset
        self.collapsedLevelsAreSubtotals = collapsedLevelsAreSubtotals
        self.axis = axis
        self.fieldPosition = fieldPosition
Ejemplo n.º 18
0
class Text(Serialisable):

    tagname = "s"

    tpls = Sequence(expected_type=TupleList)
    x = Sequence(expected_type=Index)
    v = String()
    u = Bool(allow_none=True)
    f = Bool(allow_none=True)
    c = String(allow_none=True)
    cp = Integer(allow_none=True)
    _in = Integer(allow_none=True)
    bc = HexBinary(allow_none=True)
    fc = HexBinary(allow_none=True)
    i = Bool(allow_none=True)
    un = Bool(allow_none=True)
    st = Bool(allow_none=True)
    b = Bool(allow_none=True)

    __elements__ = ('tpls', 'x')

    def __init__(self,
                 tpls=(),
                 x=(),
                 v=None,
                 u=None,
                 f=None,
                 c=None,
                 cp=None,
                 _in=None,
                 bc=None,
                 fc=None,
                 i=None,
                 un=None,
                 st=None,
                 b=None,
                 ):
        self.tpls = tpls
        self.x = x
        self.v = v
        self.u = u
        self.f = f
        self.c = c
        self.cp = cp
        self._in = _in
        self.bc = bc
        self.fc = fc
        self.i = i
        self.un = un
        self.st = st
        self.b = b
Ejemplo n.º 19
0
class Tuple(Serialisable):

    fld = Integer()
    hier = Integer()
    item = Integer()

    def __init__(self,
                 fld=None,
                 hier=None,
                 item=None,
                ):
        self.fld = fld
        self.hier = hier
        self.item = item
Ejemplo n.º 20
0
class MeasureDimensionMap(Serialisable):

    tagname = "map"

    measureGroup = Integer(allow_none=True)
    dimension = Integer(allow_none=True)

    def __init__(
        self,
        measureGroup=None,
        dimension=None,
    ):
        self.measureGroup = measureGroup
        self.dimension = dimension
Ejemplo n.º 21
0
class HSLEffect(Serialisable):

    hue = Integer()
    sat = Integer()
    lum = Integer()

    def __init__(self,
                 hue=None,
                 sat=None,
                 lum=None,
                ):
        self.hue = hue
        self.sat = sat
        self.lum = lum
Ejemplo n.º 22
0
class LevelGroup(Serialisable):

    tagname = "levelGroup"

    name = String()
    uniqueName = String()
    caption = String()
    uniqueParent = String()
    id = Integer()
    groupMembers = Typed(expected_type=GroupMembers, )

    __elements__ = ('groupMembers', )

    def __init__(
        self,
        name=None,
        uniqueName=None,
        caption=None,
        uniqueParent=None,
        id=None,
        groupMembers=None,
    ):
        self.name = name
        self.uniqueName = uniqueName
        self.caption = caption
        self.uniqueParent = uniqueParent
        self.id = id
        self.groupMembers = groupMembers
Ejemplo n.º 23
0
class PCDSDTCEntries(Serialisable):

    tagname = "pCDSDTCEntries"

    count = Integer()
    # some elements are choice
    m = Typed(expected_type=Missing, )
    n = Typed(expected_type=Number, )
    e = Typed(expected_type=Error, )
    s = Typed(expected_type=Text)

    __elements__ = ('m', 'n', 'e', 's')

    def __init__(
        self,
        count=None,
        m=None,
        n=None,
        e=None,
        s=None,
    ):
        self.count = count
        self.m = m
        self.n = n
        self.e = e
        self.s = s
Ejemplo n.º 24
0
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
Ejemplo n.º 25
0
class FileSharing(Serialisable):

    tagname = "fileSharing"

    readOnlyRecommended = Bool(allow_none=True)
    userName = String(allow_none=True)
    reservationPassword = HexBinary(allow_none=True)
    algorithmName = String(allow_none=True)
    hashValue = Base64Binary(allow_none=True)
    saltValue = Base64Binary(allow_none=True)
    spinCount = Integer(allow_none=True)

    def __init__(
        self,
        readOnlyRecommended=None,
        userName=None,
        reservationPassword=None,
        algorithmName=None,
        hashValue=None,
        saltValue=None,
        spinCount=None,
    ):
        self.readOnlyRecommended = readOnlyRecommended
        self.userName = userName
        self.reservationPassword = reservationPassword
        self.algorithmName = algorithmName
        self.hashValue = hashValue
        self.saltValue = saltValue
        self.spinCount = spinCount
Ejemplo n.º 26
0
class WebPublishObject(Serialisable):

    tagname = "webPublishingObject"

    id = Integer()
    divId = 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,
        sourceObject=None,
        destinationFile=None,
        title=None,
        autoRepublish=None,
    ):
        self.id = id
        self.divId = divId
        self.sourceObject = sourceObject
        self.destinationFile = destinationFile
        self.title = title
        self.autoRepublish = autoRepublish
Ejemplo n.º 27
0
class TableStyle(Serialisable):

    tagname = "tableStyle"

    name = String()
    pivot = Bool(allow_none=True)
    table = Bool(allow_none=True)
    count = Integer(allow_none=True)
    tableStyleElement = Typed(expected_type=TableStyleElement, allow_none=True)

    __elements__ = ('tableStyleElement', )

    def __init__(
        self,
        name=None,
        pivot=None,
        table=None,
        count=None,
        tableStyleElement=None,
    ):
        self.name = name
        self.pivot = pivot
        self.table = table
        self.count = count
        self.tableStyleElement = tableStyleElement
Ejemplo n.º 28
0
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
Ejemplo n.º 29
0
class CalculatedMember(Serialisable):

    tagname = "calculatedMember"

    name = String()
    mdx = String()
    memberName = String()
    hierarchy = String()
    parent = String()
    solveOrder = Integer()
    set = Bool()
    extLst = Typed(expected_type=ExtensionList, allow_none=True)

    __elements__ = ('extLst', )

    def __init__(
        self,
        name=None,
        mdx=None,
        memberName=None,
        hierarchy=None,
        parent=None,
        solveOrder=None,
        set=None,
        extLst=None,
    ):
        self.name = name
        self.mdx = mdx
        self.memberName = memberName
        self.hierarchy = hierarchy
        self.parent = parent
        self.solveOrder = solveOrder
        self.set = set
        self.extLst = extLst
Ejemplo n.º 30
0
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