コード例 #1
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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
コード例 #2
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
コード例 #3
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
コード例 #4
0
ファイル: dimensions.py プロジェクト: j5int/openpyxl2
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
コード例 #5
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
コード例 #6
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
コード例 #7
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
コード例 #8
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
コード例 #9
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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
コード例 #10
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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
コード例 #11
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
コード例 #12
0
ファイル: connector.py プロジェクト: j5int/openpyxl2
class Connection(Serialisable):

    id = Integer()
    idx = Integer()

    def __init__(self,
                 id=None,
                 idx=None,
                ):
        self.id = id
        self.idx = idx
コード例 #13
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
コード例 #14
0
class TintEffect(Serialisable):

    hue = Integer()
    amt = Integer()

    def __init__(
        self,
        hue=None,
        amt=None,
    ):
        self.hue = hue
        self.amt = amt
コード例 #15
0
class LuminanceEffect(Serialisable):

    bright = Integer()
    contrast = Integer()

    def __init__(
        self,
        bright=None,
        contrast=None,
    ):
        self.bright = bright
        self.contrast = contrast
コード例 #16
0
ファイル: text.py プロジェクト: j5int/openpyxl2
class TextNormalAutofit(Serialisable):

    fontScale = Integer()
    lnSpcReduction = Integer()

    def __init__(
        self,
        fontScale=None,
        lnSpcReduction=None,
    ):
        self.fontScale = fontScale
        self.lnSpcReduction = lnSpcReduction
コード例 #17
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
コード例 #18
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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
コード例 #19
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
コード例 #20
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
コード例 #21
0
class ReflectionEffect(Serialisable):

    blurRad = Float()
    stA = Integer()
    stPos = Integer()
    endA = Integer()
    endPos = Integer()
    dist = Float()
    dir = Integer()
    fadeDir = Integer()
    sx = Integer()
    sy = Integer()
    kx = Integer()
    ky = Integer()
    algn = Set(values=(['tl', 't', 'tr', 'l', 'ctr', 'r', 'bl', 'b', 'br']))
    rotWithShape = Bool(allow_none=True)

    def __init__(
        self,
        blurRad=None,
        stA=None,
        stPos=None,
        endA=None,
        endPos=None,
        dist=None,
        dir=None,
        fadeDir=None,
        sx=None,
        sy=None,
        kx=None,
        ky=None,
        algn=None,
        rotWithShape=None,
    ):
        self.blurRad = blurRad
        self.stA = stA
        self.stPos = stPos
        self.endA = endA
        self.endPos = endPos
        self.dist = dist
        self.dir = dir
        self.fadeDir = fadeDir
        self.sx = sx
        self.sy = sy
        self.kx = kx
        self.ky = ky
        self.algn = algn
        self.rotWithShape = rotWithShape
コード例 #22
0
ファイル: web.py プロジェクト: j5int/openpyxl2
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
コード例 #23
0
class ChartsheetProtection(Serialisable, _Protected):
    tagname = "sheetProtection"

    algorithmName = String(allow_none=True)
    hashValue = Base64Binary(allow_none=True)
    saltValue = Base64Binary(allow_none=True)
    spinCount = Integer(allow_none=True)
    content = Bool(allow_none=True)
    objects = Bool(allow_none=True)

    __attrs__ = ("content", "objects", "password", "hashValue", "spinCount",
                 "saltValue", "algorithmName")

    def __init__(
        self,
        content=None,
        objects=None,
        hashValue=None,
        spinCount=None,
        saltValue=None,
        algorithmName=None,
        password=None,
    ):
        self.content = content
        self.objects = objects
        self.hashValue = hashValue
        self.spinCount = spinCount
        self.saltValue = saltValue
        self.algorithmName = algorithmName
        if password is not None:
            self.password = password
コード例 #24
0
ファイル: text.py プロジェクト: j5int/openpyxl2
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
コード例 #25
0
ファイル: geometry.py プロジェクト: j5int/openpyxl2
class Transform2D(Serialisable):

    tagname = "xfrm"
    namespace = DRAWING_NS

    rot = Integer(allow_none=True)
    flipH = Bool(allow_none=True)
    flipV = Bool(allow_none=True)
    off = Typed(expected_type=Point2D, allow_none=True)
    ext = Typed(expected_type=PositiveSize2D, allow_none=True)
    chOff = Typed(expected_type=Point2D, allow_none=True)
    chExt = Typed(expected_type=PositiveSize2D, allow_none=True)

    __elements__ = ('off', 'ext', 'chOff', 'chExt')

    def __init__(
        self,
        rot=None,
        flipH=None,
        flipV=None,
        off=None,
        ext=None,
        chOff=None,
        chExt=None,
    ):
        self.rot = rot
        self.flipH = flipH
        self.flipV = flipV
        self.off = off
        self.ext = ext
        self.chOff = chOff
        self.chExt = chExt
コード例 #26
0
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
コード例 #27
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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
コード例 #28
0
ファイル: properties.py プロジェクト: j5int/openpyxl2
class NonVisualDrawingProps(Serialisable):

    tagname = "cNvPr"

    id = Integer()
    name = String()
    descr = String(allow_none=True)
    hidden = Bool(allow_none=True)
    title = String(allow_none=True)
    hlinkClick = Typed(expected_type=Hyperlink, allow_none=True)
    hlinkHover = Typed(expected_type=Hyperlink, allow_none=True)
    extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)

    __elements__ = ["hlinkClick", "hlinkHover"]

    def __init__(
        self,
        id=None,
        name=None,
        descr=None,
        hidden=None,
        title=None,
        hlinkClick=None,
        hlinkHover=None,
        extLst=None,
    ):
        self.id = id
        self.name = name
        self.descr = descr
        self.hidden = hidden
        self.title = title
        self.hlinkClick = hlinkClick
        self.hlinkHover = hlinkHover
        self.extLst = extLst
コード例 #29
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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
コード例 #30
0
ファイル: cache.py プロジェクト: j5int/openpyxl2
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