errors.py 2.4 KB

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