publish.py 1.5 KB

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