3
# Copyright (C) 2006 Google Inc.
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
9
# http://www.apache.org/licenses/LICENSE-2.0
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.
17
"""Contains extensions to Atom objects used with Google Documents."""
19
__author__ = 'api.jfisher (Jeff Fisher)'
22
from xml.etree import cElementTree as ElementTree
25
import cElementTree as ElementTree
27
from elementtree import ElementTree
32
class DocumentListEntry(gdata.GDataEntry):
33
"""The Google Documents version of an Atom Entry"""
36
_namespace = atom.ATOM_NAMESPACE
37
_children = gdata.GDataEntry._children.copy()
38
_attributes = gdata.GDataEntry._attributes.copy()
41
def DocumentListEntryFromString(xml_string):
42
"""Converts an XML string into a DocumentListEntry object.
45
xml_string: string The XML describing a Document List feed entry.
48
A DocumentListEntry object corresponding to the given XML.
50
return atom.CreateClassFromXMLString(DocumentListEntry, xml_string)
53
class DocumentListFeed(gdata.GDataFeed):
54
"""A feed containing a list of Google Documents Items"""
57
_namespace = atom.ATOM_NAMESPACE
58
_children = gdata.GDataFeed._children.copy()
59
_attributes = gdata.GDataFeed._attributes.copy()
60
_children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry',
64
def DocumentListFeedFromString(xml_string):
65
"""Converts an XML string into a DocumentListFeed object.
68
xml_string: string The XML describing a DocumentList feed.
71
A DocumentListFeed object corresponding to the given XML.
73
return atom.CreateClassFromXMLString(DocumentListFeed, xml_string)