/gdata/opensearch/data.py
Python | 48 lines | 13 code | 16 blank | 19 comment | 0 complexity | ae16642c984f37ac20db9d30fd0ebb33 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 OpenSearch Extension""" 19 20 21__author__ = 'j.s@google.com (Jeff Scudder)' 22 23 24import atom.core 25 26 27OPENSEARCH_TEMPLATE_V1 = '{http://a9.com/-/spec/opensearchrss/1.0//}%s' 28OPENSEARCH_TEMPLATE_V2 = '{http://a9.com/-/spec/opensearch/1.1//}%s' 29 30 31class ItemsPerPage(atom.core.XmlElement): 32 """Describes the number of items that will be returned per page for paged feeds""" 33 _qname = (OPENSEARCH_TEMPLATE_V1 % 'itemsPerPage', 34 OPENSEARCH_TEMPLATE_V2 % 'itemsPerPage') 35 36 37class StartIndex(atom.core.XmlElement): 38 """Describes the starting index of the contained entries for paged feeds""" 39 _qname = (OPENSEARCH_TEMPLATE_V1 % 'startIndex', 40 OPENSEARCH_TEMPLATE_V2 % 'startIndex') 41 42 43class TotalResults(atom.core.XmlElement): 44 """Describes the total number of results associated with this feed""" 45 _qname = (OPENSEARCH_TEMPLATE_V1 % 'totalResults', 46 OPENSEARCH_TEMPLATE_V2 % 'totalResults') 47 48