PageRenderTime 30ms CodeModel.GetById 12ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

/gdata/books/data.py

http://radioappz.googlecode.com/
Python | 90 lines | 41 code | 25 blank | 24 comment | 0 complexity | fbe61870f115641adda03bcee01a33a2 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 Google Book Search Data API"""
18
19
20__author__ = 'j.s@google.com (Jeff Scudder)'
21
22
23import atom.core
24import atom.data
25import gdata.data
26import gdata.dublincore.data
27import gdata.opensearch.data
28
29
30GBS_TEMPLATE = '{http://schemas.google.com/books/2008/}%s'
31
32
33class CollectionEntry(gdata.data.GDEntry):
34  """Describes an entry in a feed of collections."""
35
36
37class CollectionFeed(gdata.data.BatchFeed):
38  """Describes a Book Search collection feed."""
39  entry = [CollectionEntry]
40
41
42class Embeddability(atom.core.XmlElement):
43  """Describes an embeddability."""
44  _qname = GBS_TEMPLATE % 'embeddability'
45  value = 'value'
46
47
48class OpenAccess(atom.core.XmlElement):
49  """Describes an open access."""
50  _qname = GBS_TEMPLATE % 'openAccess'
51  value = 'value'
52
53
54class Review(atom.core.XmlElement):
55  """User-provided review."""
56  _qname = GBS_TEMPLATE % 'review'
57  lang = 'lang'
58  type = 'type'
59
60
61class Viewability(atom.core.XmlElement):
62  """Describes a viewability."""
63  _qname = GBS_TEMPLATE % 'viewability'
64  value = 'value'
65
66
67class VolumeEntry(gdata.data.GDEntry):
68  """Describes an entry in a feed of Book Search volumes."""
69  comments = gdata.data.Comments
70  language = [gdata.dublincore.data.Language]
71  open_access = OpenAccess
72  format = [gdata.dublincore.data.Format]
73  dc_title = [gdata.dublincore.data.Title]
74  viewability = Viewability
75  embeddability = Embeddability
76  creator = [gdata.dublincore.data.Creator]
77  rating = gdata.data.Rating
78  description = [gdata.dublincore.data.Description]
79  publisher = [gdata.dublincore.data.Publisher]
80  date = [gdata.dublincore.data.Date]
81  subject = [gdata.dublincore.data.Subject]
82  identifier = [gdata.dublincore.data.Identifier]
83  review = Review
84
85
86class VolumeFeed(gdata.data.BatchFeed):
87  """Describes a Book Search volume feed."""
88  entry = [VolumeEntry]
89
90