/gdata/opensearch/data.py

http://radioappz.googlecode.com/ · 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. """Contains the data classes of the OpenSearch Extension"""
  17. __author__ = 'j.s@google.com (Jeff Scudder)'
  18. import atom.core
  19. OPENSEARCH_TEMPLATE_V1 = '{http://a9.com/-/spec/opensearchrss/1.0//}%s'
  20. OPENSEARCH_TEMPLATE_V2 = '{http://a9.com/-/spec/opensearch/1.1//}%s'
  21. class ItemsPerPage(atom.core.XmlElement):
  22. """Describes the number of items that will be returned per page for paged feeds"""
  23. _qname = (OPENSEARCH_TEMPLATE_V1 % 'itemsPerPage',
  24. OPENSEARCH_TEMPLATE_V2 % 'itemsPerPage')
  25. class StartIndex(atom.core.XmlElement):
  26. """Describes the starting index of the contained entries for paged feeds"""
  27. _qname = (OPENSEARCH_TEMPLATE_V1 % 'startIndex',
  28. OPENSEARCH_TEMPLATE_V2 % 'startIndex')
  29. class TotalResults(atom.core.XmlElement):
  30. """Describes the total number of results associated with this feed"""
  31. _qname = (OPENSEARCH_TEMPLATE_V1 % 'totalResults',
  32. OPENSEARCH_TEMPLATE_V2 % 'totalResults')