Source code

Download source archive ↓

src/openpyxl/chartsheet/publish.py

1# Copyright (c) 2010-2024 openpyxl
2
3from openpyxl.descriptors import (
4    Bool,
5    Integer,
6    String,
7    Set,
8    Sequence
9)
10from openpyxl.descriptors.serialisable import Serialisable
11
12
13class WebPublishItem(Serialisable):
14    tagname = "webPublishItem"
15
16    id = Integer()
17    divId = String()
18    sourceType = Set(values=(['sheet', 'printArea', 'autoFilter', 'range', 'chart', 'pivotTable', 'query', 'label']))
19    sourceRef = String()
20    sourceObject = String(allow_none=True)
21    destinationFile = String()
22    title = String(allow_none=True)
23    autoRepublish = Bool(allow_none=True)
24
25    def __init__(self,
26                 id=None,
27                 divId=None,
28                 sourceType=None,
29                 sourceRef=None,
30                 sourceObject=None,
31                 destinationFile=None,
32                 title=None,
33                 autoRepublish=None,
34                 ):
35        self.id = id
36        self.divId = divId
37        self.sourceType = sourceType
38        self.sourceRef = sourceRef
39        self.sourceObject = sourceObject
40        self.destinationFile = destinationFile
41        self.title = title
42        self.autoRepublish = autoRepublish
43
44
45class WebPublishItems(Serialisable):
46    tagname = "WebPublishItems"
47
48    count = Integer(allow_none=True)
49    webPublishItem = Sequence(expected_type=WebPublishItem, )
50
51    __elements__ = ('webPublishItem',)
52
53    def __init__(self,
54                 count=None,
55                 webPublishItem=None,
56                 ):
57        self.count = len(webPublishItem)
58        self.webPublishItem = webPublishItem