PageRenderTime 33ms CodeModel.GetById 16ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 17"""Contains the data classes of the Yahoo! Media RSS Extension"""
 18
 19
 20__author__ = 'j.s@google.com (Jeff Scudder)'
 21
 22
 23import atom.core
 24
 25
 26MEDIA_TEMPLATE = '{http://search.yahoo.com/mrss//}%s'
 27
 28
 29class MediaCategory(atom.core.XmlElement):
 30  """Describes a media category."""
 31  _qname = MEDIA_TEMPLATE % 'category'
 32  scheme = 'scheme'
 33  label = 'label'
 34
 35
 36class MediaCopyright(atom.core.XmlElement):
 37  """Describes a media copyright."""
 38  _qname = MEDIA_TEMPLATE % 'copyright'
 39  url = 'url'
 40
 41
 42class MediaCredit(atom.core.XmlElement):
 43  """Describes a media credit."""
 44  _qname = MEDIA_TEMPLATE % 'credit'
 45  role = 'role'
 46  scheme = 'scheme'
 47
 48
 49class MediaDescription(atom.core.XmlElement):
 50  """Describes a media description."""
 51  _qname = MEDIA_TEMPLATE % 'description'
 52  type = 'type'
 53
 54
 55class MediaHash(atom.core.XmlElement):
 56  """Describes a media hash."""
 57  _qname = MEDIA_TEMPLATE % 'hash'
 58  algo = 'algo'
 59
 60
 61class MediaKeywords(atom.core.XmlElement):
 62  """Describes a media keywords."""
 63  _qname = MEDIA_TEMPLATE % 'keywords'
 64
 65
 66class MediaPlayer(atom.core.XmlElement):
 67  """Describes a media player."""
 68  _qname = MEDIA_TEMPLATE % 'player'
 69  height = 'height'
 70  width = 'width'
 71  url = 'url'
 72
 73
 74class MediaRating(atom.core.XmlElement):
 75  """Describes a media rating."""
 76  _qname = MEDIA_TEMPLATE % 'rating'
 77  scheme = 'scheme'
 78
 79
 80class MediaRestriction(atom.core.XmlElement):
 81  """Describes a media restriction."""
 82  _qname = MEDIA_TEMPLATE % 'restriction'
 83  relationship = 'relationship'
 84  type = 'type'
 85
 86
 87class MediaText(atom.core.XmlElement):
 88  """Describes a media text."""
 89  _qname = MEDIA_TEMPLATE % 'text'
 90  end = 'end'
 91  lang = 'lang'
 92  type = 'type'
 93  start = 'start'
 94
 95
 96class MediaThumbnail(atom.core.XmlElement):
 97  """Describes a media thumbnail."""
 98  _qname = MEDIA_TEMPLATE % 'thumbnail'
 99  time = 'time'
100  url = 'url'
101  width = 'width'
102  height = 'height'
103
104
105class MediaTitle(atom.core.XmlElement):
106  """Describes a media title."""
107  _qname = MEDIA_TEMPLATE % 'title'
108  type = 'type'
109
110
111class MediaContent(atom.core.XmlElement):
112  """Describes a media content."""
113  _qname = MEDIA_TEMPLATE % 'content'
114  bitrate = 'bitrate'
115  is_default = 'isDefault'
116  medium = 'medium'
117  height = 'height'
118  credit = [MediaCredit]
119  language = 'language'
120  hash = MediaHash
121  width = 'width'
122  player = MediaPlayer
123  url = 'url'
124  file_size = 'fileSize'
125  channels = 'channels'
126  expression = 'expression'
127  text = [MediaText]
128  samplingrate = 'samplingrate'
129  title = MediaTitle
130  category = [MediaCategory]
131  rating = [MediaRating]
132  type = 'type'
133  description = MediaDescription
134  framerate = 'framerate'
135  thumbnail = [MediaThumbnail]
136  duration = 'duration'
137  copyright = MediaCopyright
138  keywords = MediaKeywords
139  restriction = [MediaRestriction]
140
141
142class MediaGroup(atom.core.XmlElement):
143  """Describes a media group."""
144  _qname = MEDIA_TEMPLATE % 'group'
145  credit = [MediaCredit]
146  content = [MediaContent]
147  copyright = MediaCopyright
148  description = MediaDescription
149  category = [MediaCategory]
150  player = MediaPlayer
151  rating = [MediaRating]
152  hash = MediaHash
153  title = MediaTitle
154  keywords = MediaKeywords
155  restriction = [MediaRestriction]
156  thumbnail = [MediaThumbnail]
157  text = [MediaText]
158
159