src/openpyxl/worksheet/errors.py
1#Autogenerated schema
2from openpyxl.descriptors.serialisable import Serialisable
3from openpyxl.descriptors import (
4 Typed,
5 String,
6 Bool,
7 Sequence,
8)
9from openpyxl.descriptors.excel import CellRange
10
11
12class Extension(Serialisable):
13
14 tagname = "extension"
15
16 uri = String(allow_none=True)
17
18 def __init__(self,
19 uri=None,
20 ):
21 self.uri = uri
22
23
24class ExtensionList(Serialisable):
25
26 tagname = "extensionList"
27
28 # uses element group EG_ExtensionList
29 ext = Sequence(expected_type=Extension)
30
31 __elements__ = ('ext',)
32
33 def __init__(self,
34 ext=(),
35 ):
36 self.ext = ext
37
38
39class IgnoredError(Serialisable):
40
41 tagname = "ignoredError"
42
43 sqref = CellRange
44 evalError = Bool(allow_none=True)
45 twoDigitTextYear = Bool(allow_none=True)
46 numberStoredAsText = Bool(allow_none=True)
47 formula = Bool(allow_none=True)
48 formulaRange = Bool(allow_none=True)
49 unlockedFormula = Bool(allow_none=True)
50 emptyCellReference = Bool(allow_none=True)
51 listDataValidation = Bool(allow_none=True)
52 calculatedColumn = Bool(allow_none=True)
53
54 def __init__(self,
55 sqref=None,
56 evalError=False,
57 twoDigitTextYear=False,
58 numberStoredAsText=False,
59 formula=False,
60 formulaRange=False,
61 unlockedFormula=False,
62 emptyCellReference=False,
63 listDataValidation=False,
64 calculatedColumn=False,
65 ):
66 self.sqref = sqref
67 self.evalError = evalError
68 self.twoDigitTextYear = twoDigitTextYear
69 self.numberStoredAsText = numberStoredAsText
70 self.formula = formula
71 self.formulaRange = formulaRange
72 self.unlockedFormula = unlockedFormula
73 self.emptyCellReference = emptyCellReference
74 self.listDataValidation = listDataValidation
75 self.calculatedColumn = calculatedColumn
76
77
78class IgnoredErrors(Serialisable):
79
80 tagname = "ignoredErrors"
81
82 ignoredError = Sequence(expected_type=IgnoredError)
83 extLst = Typed(expected_type=ExtensionList, allow_none=True)
84
85 __elements__ = ('ignoredError', 'extLst')
86
87 def __init__(self,
88 ignoredError=(),
89 extLst=None,
90 ):
91 self.ignoredError = ignoredError
92 self.extLst = extLst
93