/gdata/media/data.py

http://radioappz.googlecode.com/ · Python · 159 lines · 92 code · 37 blank · 30 comment · 0 complexity · 521382e5d99cbc1e4d2813ddaf9ca75b MD5 · raw file

  1. #!/usr/bin/python
  2. #
  3. # Copyright (C) 2009 Google Inc.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. """Contains the data classes of the Yahoo! Media RSS Extension"""
  17. __author__ = 'j.s@google.com (Jeff Scudder)'
  18. import atom.core
  19. MEDIA_TEMPLATE = '{http://search.yahoo.com/mrss//}%s'
  20. class MediaCategory(atom.core.XmlElement):
  21. """Describes a media category."""
  22. _qname = MEDIA_TEMPLATE % 'category'
  23. scheme = 'scheme'
  24. label = 'label'
  25. class MediaCopyright(atom.core.XmlElement):
  26. """Describes a media copyright."""
  27. _qname = MEDIA_TEMPLATE % 'copyright'
  28. url = 'url'
  29. class MediaCredit(atom.core.XmlElement):
  30. """Describes a media credit."""
  31. _qname = MEDIA_TEMPLATE % 'credit'
  32. role = 'role'
  33. scheme = 'scheme'
  34. class MediaDescription(atom.core.XmlElement):
  35. """Describes a media description."""
  36. _qname = MEDIA_TEMPLATE % 'description'
  37. type = 'type'
  38. class MediaHash(atom.core.XmlElement):
  39. """Describes a media hash."""
  40. _qname = MEDIA_TEMPLATE % 'hash'
  41. algo = 'algo'
  42. class MediaKeywords(atom.core.XmlElement):
  43. """Describes a media keywords."""
  44. _qname = MEDIA_TEMPLATE % 'keywords'
  45. class MediaPlayer(atom.core.XmlElement):
  46. """Describes a media player."""
  47. _qname = MEDIA_TEMPLATE % 'player'
  48. height = 'height'
  49. width = 'width'
  50. url = 'url'
  51. class MediaRating(atom.core.XmlElement):
  52. """Describes a media rating."""
  53. _qname = MEDIA_TEMPLATE % 'rating'
  54. scheme = 'scheme'
  55. class MediaRestriction(atom.core.XmlElement):
  56. """Describes a media restriction."""
  57. _qname = MEDIA_TEMPLATE % 'restriction'
  58. relationship = 'relationship'
  59. type = 'type'
  60. class MediaText(atom.core.XmlElement):
  61. """Describes a media text."""
  62. _qname = MEDIA_TEMPLATE % 'text'
  63. end = 'end'
  64. lang = 'lang'
  65. type = 'type'
  66. start = 'start'
  67. class MediaThumbnail(atom.core.XmlElement):
  68. """Describes a media thumbnail."""
  69. _qname = MEDIA_TEMPLATE % 'thumbnail'
  70. time = 'time'
  71. url = 'url'
  72. width = 'width'
  73. height = 'height'
  74. class MediaTitle(atom.core.XmlElement):
  75. """Describes a media title."""
  76. _qname = MEDIA_TEMPLATE % 'title'
  77. type = 'type'
  78. class MediaContent(atom.core.XmlElement):
  79. """Describes a media content."""
  80. _qname = MEDIA_TEMPLATE % 'content'
  81. bitrate = 'bitrate'
  82. is_default = 'isDefault'
  83. medium = 'medium'
  84. height = 'height'
  85. credit = [MediaCredit]
  86. language = 'language'
  87. hash = MediaHash
  88. width = 'width'
  89. player = MediaPlayer
  90. url = 'url'
  91. file_size = 'fileSize'
  92. channels = 'channels'
  93. expression = 'expression'
  94. text = [MediaText]
  95. samplingrate = 'samplingrate'
  96. title = MediaTitle
  97. category = [MediaCategory]
  98. rating = [MediaRating]
  99. type = 'type'
  100. description = MediaDescription
  101. framerate = 'framerate'
  102. thumbnail = [MediaThumbnail]
  103. duration = 'duration'
  104. copyright = MediaCopyright
  105. keywords = MediaKeywords
  106. restriction = [MediaRestriction]
  107. class MediaGroup(atom.core.XmlElement):
  108. """Describes a media group."""
  109. _qname = MEDIA_TEMPLATE % 'group'
  110. credit = [MediaCredit]
  111. content = [MediaContent]
  112. copyright = MediaCopyright
  113. description = MediaDescription
  114. category = [MediaCategory]
  115. player = MediaPlayer
  116. rating = [MediaRating]
  117. hash = MediaHash
  118. title = MediaTitle
  119. keywords = MediaKeywords
  120. restriction = [MediaRestriction]
  121. thumbnail = [MediaThumbnail]
  122. text = [MediaText]