PageRenderTime 34ms CodeModel.GetById 19ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/gdata/webmastertools/data.py

http://radioappz.googlecode.com/
Python | 217 lines | 92 code | 76 blank | 49 comment | 0 complexity | 1ad04e89361e3e9f86706b56a1f062fc 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
 18"""Contains the data classes of the Google Webmaster Tools Data API"""
 19
 20
 21__author__ = 'j.s@google.com (Jeff Scudder)'
 22
 23
 24import atom.core
 25import atom.data
 26import gdata.data
 27import gdata.opensearch.data
 28
 29
 30WT_TEMPLATE = '{http://schemas.google.com/webmaster/tools/2007/}%s'
 31
 32
 33class CrawlIssueCrawlType(atom.core.XmlElement):
 34  """Type of crawl of the crawl issue"""
 35  _qname = WT_TEMPLATE % 'crawl-type'
 36
 37
 38class CrawlIssueDateDetected(atom.core.XmlElement):
 39  """Detection date for the issue"""
 40  _qname = WT_TEMPLATE % 'date-detected'
 41
 42
 43class CrawlIssueDetail(atom.core.XmlElement):
 44  """Detail of the crawl issue"""
 45  _qname = WT_TEMPLATE % 'detail'
 46
 47
 48class CrawlIssueIssueType(atom.core.XmlElement):
 49  """Type of crawl issue"""
 50  _qname = WT_TEMPLATE % 'issue-type'
 51
 52
 53class CrawlIssueLinkedFromUrl(atom.core.XmlElement):
 54  """Source URL that links to the issue URL"""
 55  _qname = WT_TEMPLATE % 'linked-from'
 56
 57
 58class CrawlIssueUrl(atom.core.XmlElement):
 59  """URL affected by the crawl issue"""
 60  _qname = WT_TEMPLATE % 'url'
 61
 62
 63class CrawlIssueEntry(gdata.data.GDEntry):
 64  """Describes a crawl issue entry"""
 65  date_detected = CrawlIssueDateDetected
 66  url = CrawlIssueUrl
 67  detail = CrawlIssueDetail
 68  issue_type = CrawlIssueIssueType
 69  crawl_type = CrawlIssueCrawlType
 70  linked_from = [CrawlIssueLinkedFromUrl]
 71
 72
 73class CrawlIssuesFeed(gdata.data.GDFeed):
 74  """Feed of crawl issues for a particular site"""
 75  entry = [CrawlIssueEntry]
 76
 77
 78class Indexed(atom.core.XmlElement):
 79  """Describes the indexing status of a site"""
 80  _qname = WT_TEMPLATE % 'indexed'
 81
 82
 83class Keyword(atom.core.XmlElement):
 84  """A keyword in a site or in a link to a site"""
 85  _qname = WT_TEMPLATE % 'keyword'
 86  source = 'source'
 87
 88
 89class KeywordEntry(gdata.data.GDEntry):
 90  """Describes a keyword entry"""
 91
 92
 93class KeywordsFeed(gdata.data.GDFeed):
 94  """Feed of keywords for a particular site"""
 95  entry = [KeywordEntry]
 96  keyword = [Keyword]
 97
 98
 99class LastCrawled(atom.core.XmlElement):
100  """Describes the last crawled date of a site"""
101  _qname = WT_TEMPLATE % 'last-crawled'
102
103
104class MessageBody(atom.core.XmlElement):
105  """Message body"""
106  _qname = WT_TEMPLATE % 'body'
107
108
109class MessageDate(atom.core.XmlElement):
110  """Message date"""
111  _qname = WT_TEMPLATE % 'date'
112
113
114class MessageLanguage(atom.core.XmlElement):
115  """Message language"""
116  _qname = WT_TEMPLATE % 'language'
117
118
119class MessageRead(atom.core.XmlElement):
120  """Indicates if the message has already been read"""
121  _qname = WT_TEMPLATE % 'read'
122
123
124class MessageSubject(atom.core.XmlElement):
125  """Message subject"""
126  _qname = WT_TEMPLATE % 'subject'
127
128
129class SiteId(atom.core.XmlElement):
130  """Site URL"""
131  _qname = WT_TEMPLATE % 'id'
132
133
134class MessageEntry(gdata.data.GDEntry):
135  """Describes a message entry"""
136  wt_id = SiteId
137  subject = MessageSubject
138  date = MessageDate
139  body = MessageBody
140  language = MessageLanguage
141  read = MessageRead
142
143
144class MessagesFeed(gdata.data.GDFeed):
145  """Describes a messages feed"""
146  entry = [MessageEntry]
147
148
149class SitemapEntry(gdata.data.GDEntry):
150  """Describes a sitemap entry"""
151  indexed = Indexed
152  wt_id = SiteId
153
154
155class SitemapMobileMarkupLanguage(atom.core.XmlElement):
156  """Describes a markup language for URLs in this sitemap"""
157  _qname = WT_TEMPLATE % 'sitemap-mobile-markup-language'
158
159
160class SitemapMobile(atom.core.XmlElement):
161  """Lists acceptable mobile markup languages for URLs in this sitemap"""
162  _qname = WT_TEMPLATE % 'sitemap-mobile'
163  sitemap_mobile_markup_language = [SitemapMobileMarkupLanguage]
164
165
166class SitemapNewsPublicationLabel(atom.core.XmlElement):
167  """Specifies the publication label for this sitemap"""
168  _qname = WT_TEMPLATE % 'sitemap-news-publication-label'
169
170
171class SitemapNews(atom.core.XmlElement):
172  """Lists publication labels for this sitemap"""
173  _qname = WT_TEMPLATE % 'sitemap-news'
174  sitemap_news_publication_label = [SitemapNewsPublicationLabel]
175
176
177class SitemapType(atom.core.XmlElement):
178  """Indicates the type of sitemap. Not used for News or Mobile Sitemaps"""
179  _qname = WT_TEMPLATE % 'sitemap-type'
180
181
182class SitemapUrlCount(atom.core.XmlElement):
183  """Indicates the number of URLs contained in the sitemap"""
184  _qname = WT_TEMPLATE % 'sitemap-url-count'
185
186
187class SitemapsFeed(gdata.data.GDFeed):
188  """Describes a sitemaps feed"""
189  entry = [SitemapEntry]
190
191
192class VerificationMethod(atom.core.XmlElement):
193  """Describes a verification method that may be used for a site"""
194  _qname = WT_TEMPLATE % 'verification-method'
195  in_use = 'in-use'
196  type = 'type'
197
198
199class Verified(atom.core.XmlElement):
200  """Describes the verification status of a site"""
201  _qname = WT_TEMPLATE % 'verified'
202
203
204class SiteEntry(gdata.data.GDEntry):
205  """Describes a site entry"""
206  indexed = Indexed
207  wt_id = SiteId
208  verified = Verified
209  last_crawled = LastCrawled
210  verification_method = [VerificationMethod]
211
212
213class SitesFeed(gdata.data.GDFeed):
214  """Describes a sites feed"""
215  entry = [SiteEntry]
216
217