views.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. from __future__ import absolute_import
  2. # Copyright (c) 2010-2019 openpyxl
  3. from openpyxl.descriptors.serialisable import Serialisable
  4. from openpyxl.descriptors import (
  5. Typed,
  6. Sequence,
  7. String,
  8. Float,
  9. Integer,
  10. Bool,
  11. NoneSet,
  12. Set,
  13. )
  14. from openpyxl.descriptors.excel import (
  15. ExtensionList,
  16. Guid,
  17. )
  18. class BookView(Serialisable):
  19. tagname = "workbookView"
  20. visibility = NoneSet(values=(['visible', 'hidden', 'veryHidden']))
  21. minimized = Bool(allow_none=True)
  22. showHorizontalScroll = Bool(allow_none=True)
  23. showVerticalScroll = Bool(allow_none=True)
  24. showSheetTabs = Bool(allow_none=True)
  25. xWindow = Integer(allow_none=True)
  26. yWindow = Integer(allow_none=True)
  27. windowWidth = Integer(allow_none=True)
  28. windowHeight = Integer(allow_none=True)
  29. tabRatio = Integer(allow_none=True)
  30. firstSheet = Integer(allow_none=True)
  31. activeTab = Integer(allow_none=True)
  32. autoFilterDateGrouping = Bool(allow_none=True)
  33. extLst = Typed(expected_type=ExtensionList, allow_none=True)
  34. __elements__ = ()
  35. def __init__(self,
  36. visibility="visible",
  37. minimized=False,
  38. showHorizontalScroll=True,
  39. showVerticalScroll=True,
  40. showSheetTabs=True,
  41. xWindow=None,
  42. yWindow=None,
  43. windowWidth=None,
  44. windowHeight=None,
  45. tabRatio=600,
  46. firstSheet=0,
  47. activeTab=0,
  48. autoFilterDateGrouping=True,
  49. extLst=None,
  50. ):
  51. self.visibility = visibility
  52. self.minimized = minimized
  53. self.showHorizontalScroll = showHorizontalScroll
  54. self.showVerticalScroll = showVerticalScroll
  55. self.showSheetTabs = showSheetTabs
  56. self.xWindow = xWindow
  57. self.yWindow = yWindow
  58. self.windowWidth = windowWidth
  59. self.windowHeight = windowHeight
  60. self.tabRatio = tabRatio
  61. self.firstSheet = firstSheet
  62. self.activeTab = activeTab
  63. self.autoFilterDateGrouping = autoFilterDateGrouping
  64. class CustomWorkbookView(Serialisable):
  65. tagname = "customWorkbookView"
  66. name = String()
  67. guid = Guid()
  68. autoUpdate = Bool(allow_none=True)
  69. mergeInterval = Integer(allow_none=True)
  70. changesSavedWin = Bool(allow_none=True)
  71. onlySync = Bool(allow_none=True)
  72. personalView = Bool(allow_none=True)
  73. includePrintSettings = Bool(allow_none=True)
  74. includeHiddenRowCol = Bool(allow_none=True)
  75. maximized = Bool(allow_none=True)
  76. minimized = Bool(allow_none=True)
  77. showHorizontalScroll = Bool(allow_none=True)
  78. showVerticalScroll = Bool(allow_none=True)
  79. showSheetTabs = Bool(allow_none=True)
  80. xWindow = Integer(allow_none=True)
  81. yWindow = Integer(allow_none=True)
  82. windowWidth = Integer()
  83. windowHeight = Integer()
  84. tabRatio = Integer(allow_none=True)
  85. activeSheetId = Integer()
  86. showFormulaBar = Bool(allow_none=True)
  87. showStatusbar = Bool(allow_none=True)
  88. showComments = NoneSet(values=(['commNone', 'commIndicator',
  89. 'commIndAndComment']))
  90. showObjects = NoneSet(values=(['all', 'placeholders']))
  91. extLst = Typed(expected_type=ExtensionList, allow_none=True)
  92. __elements__ = ()
  93. def __init__(self,
  94. name=None,
  95. guid=None,
  96. autoUpdate=None,
  97. mergeInterval=None,
  98. changesSavedWin=None,
  99. onlySync=None,
  100. personalView=None,
  101. includePrintSettings=None,
  102. includeHiddenRowCol=None,
  103. maximized=None,
  104. minimized=None,
  105. showHorizontalScroll=None,
  106. showVerticalScroll=None,
  107. showSheetTabs=None,
  108. xWindow=None,
  109. yWindow=None,
  110. windowWidth=None,
  111. windowHeight=None,
  112. tabRatio=None,
  113. activeSheetId=None,
  114. showFormulaBar=None,
  115. showStatusbar=None,
  116. showComments="commIndicator",
  117. showObjects="all",
  118. extLst=None,
  119. ):
  120. self.name = name
  121. self.guid = guid
  122. self.autoUpdate = autoUpdate
  123. self.mergeInterval = mergeInterval
  124. self.changesSavedWin = changesSavedWin
  125. self.onlySync = onlySync
  126. self.personalView = personalView
  127. self.includePrintSettings = includePrintSettings
  128. self.includeHiddenRowCol = includeHiddenRowCol
  129. self.maximized = maximized
  130. self.minimized = minimized
  131. self.showHorizontalScroll = showHorizontalScroll
  132. self.showVerticalScroll = showVerticalScroll
  133. self.showSheetTabs = showSheetTabs
  134. self.xWindow = xWindow
  135. self.yWindow = yWindow
  136. self.windowWidth = windowWidth
  137. self.windowHeight = windowHeight
  138. self.tabRatio = tabRatio
  139. self.activeSheetId = activeSheetId
  140. self.showFormulaBar = showFormulaBar
  141. self.showStatusbar = showStatusbar
  142. self.showComments = showComments
  143. self.showObjects = showObjects