publish.py 1.6 KB

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