web.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright (c) 2010-2024 openpyxl
  2. from openpyxl.descriptors.serialisable import Serialisable
  3. from openpyxl.descriptors import (
  4. Typed,
  5. Sequence,
  6. String,
  7. Float,
  8. Integer,
  9. Bool,
  10. NoneSet,
  11. )
  12. class WebPublishObject(Serialisable):
  13. tagname = "webPublishingObject"
  14. id = Integer()
  15. divId = 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. sourceObject=None,
  24. destinationFile=None,
  25. title=None,
  26. autoRepublish=None,
  27. ):
  28. self.id = id
  29. self.divId = divId
  30. self.sourceObject = sourceObject
  31. self.destinationFile = destinationFile
  32. self.title = title
  33. self.autoRepublish = autoRepublish
  34. class WebPublishObjectList(Serialisable):
  35. tagname ="webPublishingObjects"
  36. count = Integer(allow_none=True)
  37. webPublishObject = Sequence(expected_type=WebPublishObject)
  38. __elements__ = ('webPublishObject',)
  39. def __init__(self,
  40. count=None,
  41. webPublishObject=(),
  42. ):
  43. self.webPublishObject = webPublishObject
  44. @property
  45. def count(self):
  46. return len(self.webPublishObject)
  47. class WebPublishing(Serialisable):
  48. tagname = "webPublishing"
  49. css = Bool(allow_none=True)
  50. thicket = Bool(allow_none=True)
  51. longFileNames = Bool(allow_none=True)
  52. vml = Bool(allow_none=True)
  53. allowPng = Bool(allow_none=True)
  54. targetScreenSize = NoneSet(values=(['544x376', '640x480', '720x512', '800x600',
  55. '1024x768', '1152x882', '1152x900', '1280x1024', '1600x1200',
  56. '1800x1440', '1920x1200']))
  57. dpi = Integer(allow_none=True)
  58. codePage = Integer(allow_none=True)
  59. characterSet = String(allow_none=True)
  60. def __init__(self,
  61. css=None,
  62. thicket=None,
  63. longFileNames=None,
  64. vml=None,
  65. allowPng=None,
  66. targetScreenSize='800x600',
  67. dpi=None,
  68. codePage=None,
  69. characterSet=None,
  70. ):
  71. self.css = css
  72. self.thicket = thicket
  73. self.longFileNames = longFileNames
  74. self.vml = vml
  75. self.allowPng = allowPng
  76. self.targetScreenSize = targetScreenSize
  77. self.dpi = dpi
  78. self.codePage = codePage
  79. self.characterSet = characterSet