web.py 2.6 KB

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