diff -Nru python-httplib2-0.8/CHANGELOG python-httplib2-0.9+dfsg/CHANGELOG --- python-httplib2-0.8/CHANGELOG 2013-03-06 20:40:54.000000000 +0000 +++ python-httplib2-0.9+dfsg/CHANGELOG 2014-04-15 12:53:06.000000000 +0000 @@ -7,7 +7,6 @@ Lots of clean up of the code formatting to make it more consistent. - 0.7.7 More fixes for App Engine, now less likely to swallow important exceptions. Adding proxy_info_from_* methods to Python3. Reviewed in https://codereview.appspot.com/6588078/. diff -Nru python-httplib2-0.8/debian/changelog python-httplib2-0.9+dfsg/debian/changelog --- python-httplib2-0.8/debian/changelog 2014-02-23 13:51:48.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/changelog 2014-04-28 20:33:09.000000000 +0000 @@ -1,8 +1,22 @@ -python-httplib2 (0.8-2build1) trusty; urgency=medium +python-httplib2 (0.9+dfsg-1) unstable; urgency=medium - * Rebuild to drop files installed into /usr/share/pyshared. + * New upstream release. + * debian/patches/use_system_cacerts.patch: + - Refresh for new upstream release. + * debian/control: + - Update Homepage field to the new location. + - Bump Standards-Version to 3.9.5, no changes required. + * debian/copyright: + - Adjust copyright years. + * debian/python3-httplib2.docs: + - Install documentation for python3-httplib2 package too. + * debian/rules: + - Switch to pybuild. + - Provide get-orig-source target. + * debian/watch: + - Point to GitHub portal. - -- Matthias Klose Sun, 23 Feb 2014 13:51:48 +0000 + -- Luca Falavigna Mon, 28 Apr 2014 22:33:06 +0200 python-httplib2 (0.8-2) unstable; urgency=low diff -Nru python-httplib2-0.8/debian/control python-httplib2-0.9+dfsg/debian/control --- python-httplib2-0.8/debian/control 2013-08-16 15:47:22.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/control 2014-04-28 19:52:02.000000000 +0000 @@ -6,9 +6,9 @@ Build-Depends: debhelper (>= 9), python-all (>= 2.6.6-3~), python3-all (>= 3.1.2-10) -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 X-Python-Version: >= 2.4 -Homepage: http://code.google.com/p/httplib2/ +Homepage: https://github.com/jcgregorio/httplib2 Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-httplib2/trunk/ Vcs-Browser: http://anonscm.debian.org/viewsvn/python-modules/packages/python-httplib2/trunk/ diff -Nru python-httplib2-0.8/debian/copyright python-httplib2-0.9+dfsg/debian/copyright --- python-httplib2-0.8/debian/copyright 2013-08-16 15:47:22.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/copyright 2014-04-28 19:43:41.000000000 +0000 @@ -18,7 +18,7 @@ Files: debian/* Copyright: 2006, Matthias Jahn - 2009-2011, Luca Falavigna + 2009-2014, Luca Falavigna License: GPL-3+ License: MIT diff -Nru python-httplib2-0.8/debian/docs python-httplib2-0.9+dfsg/debian/docs --- python-httplib2-0.8/debian/docs 2013-08-16 15:47:22.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/docs 2014-04-28 20:02:11.000000000 +0000 @@ -1 +1 @@ -README +README.md diff -Nru python-httplib2-0.8/debian/patches/use_system_cacerts.patch python-httplib2-0.9+dfsg/debian/patches/use_system_cacerts.patch --- python-httplib2-0.8/debian/patches/use_system_cacerts.patch 2013-08-16 15:47:22.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/patches/use_system_cacerts.patch 2014-04-28 19:48:12.000000000 +0000 @@ -39,7 +39,7 @@ =================================================================== --- a/setup.py 2013-03-18 22:37:43.423868573 +0100 +++ b/setup.py 2013-03-18 22:37:43.419868572 +0100 -@@ -62,7 +62,6 @@ +@@ -61,7 +61,6 @@ """, package_dir=pkgdir, packages=['httplib2'], diff -Nru python-httplib2-0.8/debian/python3-httplib2.docs python-httplib2-0.9+dfsg/debian/python3-httplib2.docs --- python-httplib2-0.8/debian/python3-httplib2.docs 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/python3-httplib2.docs 2014-04-28 20:02:11.000000000 +0000 @@ -0,0 +1 @@ +README.md diff -Nru python-httplib2-0.8/debian/rules python-httplib2-0.9+dfsg/debian/rules --- python-httplib2-0.8/debian/rules 2013-08-16 15:49:32.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/rules 2014-04-28 20:32:28.000000000 +0000 @@ -1,22 +1,15 @@ #!/usr/bin/make -f -%: - dh $@ --with python2 - -override_dh_auto_clean: - rm -fr build python*/*.egg-info - dh_auto_clean +export PYBUILD_NAME=httplib2 +VERSION = $(shell head -n1 debian/changelog | sed -e 's/.*(//;s/+.*).*//') -override_dh_auto_install: - for pyvers in $(shell pyversions -vr); do \ - python$$pyvers setup.py install --install-layout=deb \ - --root $(CURDIR)/debian/python-httplib2; \ - done - for pyvers in $(shell py3versions -sv); do \ - python$$pyvers setup.py install --install-layout=deb \ - --root $(CURDIR)/debian/python3-httplib2; \ - done +%: + dh $@ --buildsystem pybuild --with python2,python3 -override_dh_python2: - dh_python2 -ppython-httplib2 - dh_python3 -ppython3-httplib2 +get-orig-source: + wget https://github.com/jcgregorio/httplib2/archive/v${VERSION}.tar.gz -O ../python-httplib2-${VERSION}.tar.gz + tar fxz ../python-httplib2-${VERSION}.tar.gz -C ../ && mv ../httplib2-${VERSION} ../python-httplib2-${VERSION}+dfsg + find ../python-httplib2-${VERSION}+dfsg -name "*searchindex.js" -delete + find ../python-httplib2-${VERSION}+dfsg -name "*interface.js" -delete + tar czf ../python-httplib2_${VERSION}+dfsg.orig.tar.gz ../python-httplib2-${VERSION}+dfsg + rm -fr ../python-httplib2-${VERSION}.tar.gz ../python-httplib2-${VERSION}+dfsg diff -Nru python-httplib2-0.8/debian/watch python-httplib2-0.9+dfsg/debian/watch --- python-httplib2-0.8/debian/watch 2013-08-16 15:47:22.000000000 +0000 +++ python-httplib2-0.9+dfsg/debian/watch 2014-04-28 20:08:18.000000000 +0000 @@ -1,2 +1,3 @@ version=3 -http://code.google.com/p/httplib2/downloads/list?can=1 .*/httplib2-(\d[\d\.]*)\.tar\.gz +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/httplib2-$1\.tar\.gz/,dversionmangle=s/\+dfsg// \ + https://github.com/jcgregorio/httplib2/tags .*/v?(\d\S*)\.tar\.gz diff -Nru python-httplib2-0.8/doc/conf.py python-httplib2-0.9+dfsg/doc/conf.py --- python-httplib2-0.8/doc/conf.py 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/conf.py 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +# +# httplib2 documentation build configuration file, created by +# sphinx-quickstart on Thu Mar 27 16:07:14 2008. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# The contents of this file are pickled, so don't put values in the namespace +# that aren't pickleable (module imports are okay, they're removed automatically). +# +# All configuration values have a default value; values that are commented out +# serve to show the default value. + +import sys + +# If your extensions are in another directory, add it here. +#sys.path.append('some/directory') + +# General configuration +# --------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +#extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['.templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General substitutions. +project = 'httplib2' +copyright = '2008, Joe Gregorio' + +# The default replacements for |version| and |release|, also used in various +# other places throughout the built documents. +# +# The short X.Y version. +version = '0.4' +# The full version, including alpha/beta/rc tags. +release = '0.4' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# Options for HTML output +# ----------------------- + +# The style sheet to use for HTML and HTML Help pages. A file of that name +# must exist either in Sphinx' static/ path, or in one of the custom paths +# given in html_static_path. +html_style = 'default.css' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['.static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Content template for the index page. +#html_index = '' + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_use_modindex = True + +# If true, the reST sources are included in the HTML build as _sources/. +#html_copy_source = True + +# Output file base name for HTML help builder. +htmlhelp_basename = 'httplib2doc' + + +# Options for LaTeX output +# ------------------------ + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, document class [howto/manual]). +#latex_documents = [] + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True diff -Nru python-httplib2-0.8/doc/html/genindex.html python-httplib2-0.9+dfsg/doc/html/genindex.html --- python-httplib2-0.8/doc/html/genindex.html 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/genindex.html 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,207 @@ + + + + + + + Index — httplib2 v0.4 documentation + + + + + + + + + + +
+ +
+
+ + + + + +
+
+
+
+ + + + diff -Nru python-httplib2-0.8/doc/html/index.html python-httplib2-0.9+dfsg/doc/html/index.html --- python-httplib2-0.8/doc/html/index.html 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/index.html 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,144 @@ + + + + + + + The httplib2 Library — httplib2 v0.4 documentation + + + + + + + + + + + +
+
+
+
+ +
+

The httplib2 Library

+ +++ + + + + + +
Author:Joe Gregorio
Date:Mar 8, 2007
+
+

Abstract

+

The httplib2 module is a comprehensive HTTP client library that handles +caching, keep-alive, compression, redirects and many kinds of authentication.

+
+

Contents:

+ +
+

Indices and tables

+ +
+
+ + +
+
+
+
+
+

Table Of Contents

+ + +

Next topic

+

httplib2 A comprehensive HTTP client library.

+

This Page

+ + + +
+
+
+
+ + + + diff -Nru python-httplib2-0.8/doc/html/libhttplib2.html python-httplib2-0.9+dfsg/doc/html/libhttplib2.html --- python-httplib2-0.8/doc/html/libhttplib2.html 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/libhttplib2.html 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,490 @@ + + + + + + + httplib2 A comprehensive HTTP client library. — httplib2 v0.4 documentation + + + + + + + + + + + +
+
+
+
+ +
+

httplib2 A comprehensive HTTP client library.

+

The httplib2 module is a comprehensive HTTP client library with the +following features:

+
+
+HTTP and HTTPS
+
HTTPS support is only available if the socket module was compiled with SSL +support.
+ +
+
+Keep-Alive
+
Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple +requests over the same connection if possible.
+ +
+
+Authentication
+

The following three types of HTTP Authentication are supported. These can be +used over both HTTP and HTTPS.

+
+
    +
  • Digest
  • +
  • Basic
  • +
  • WSSE
  • +
+
+
+ +
+
+Caching
+
The module can optionally operate with a private cache that understands the +Cache-Control: header and uses both the ETag and Last-Modified cache validators.
+ +
+
+All Methods
+
The module can handle any HTTP request method, not just GET and POST.
+ +
+
+Redirects
+
Automatically follows 3XX redirects on GETs.
+ +
+
+Compression
+
Handles both deflate and gzip types of compression.
+ +
+
+Lost update support
+
Automatically adds back ETags into PUT requests to resources we have already +cached. This implements Section 3.2 of Detecting the Lost Update Problem Using +Unreserved Checkout
+ +

The httplib2 module defines the following variables:

+
+
+httplib2.debuglevel
+
The amount of debugging information to print. The default is 0.
+ +
+
+httplib2.RETRIES
+
A request will be tried ‘RETRIES’ times if it fails at the socket/connection level. +The default is 2.
+ +

The httplib2 module may raise the following Exceptions. Note that there +is an option that turns exceptions into normal responses with an HTTP status +code indicating an error occured. See +Http.force_exception_to_status_code

+
+
+exception httplib2.HttpLib2Error
+
The Base Exception for all exceptions raised by httplib2.
+ +
+
+exception httplib2.RedirectMissingLocation
+
A 3xx redirect response code was provided but no Location: header was provided +to point to the new location.
+ +
+
+exception httplib2.RedirectLimit
+
The maximum number of redirections was reached without coming to a final URI.
+ +
+
+exception httplib2.ServerNotFoundError
+
Unable to resolve the host name given.
+ +
+
+exception httplib2.RelativeURIError
+
A relative, as opposed to an absolute URI, was passed into request().
+ +
+
+exception httplib2.FailedToDecompressContent
+
The headers claimed that the content of the response was compressed but the +decompression algorithm applied to the content failed.
+ +
+
+exception httplib2.UnimplementedDigestAuthOptionError
+
The server requested a type of Digest authentication that we are unfamiliar +with.
+ +
+
+exception httplib2.UnimplementedHmacDigestAuthOptionError
+
The server requested a type of HMACDigest authentication that we are unfamiliar +with.
+ +
+
+class httplib2.Http([cache=None][, timeout=None][, proxy_info==ProxyInfo.from_environment][, ca_certs=None][, disable_ssl_certificate_validation=False])
+
The class that represents a client HTTP interface. The cache parameter is +either the name of a directory to be used as a flat file cache, or it must an +object that implements the required caching interface. The timeout parameter +is the socket level timeout. The ca_certs parameter is the filename of the +CA certificates to use. If none is given a default set is used. The +disable_ssl_certificate_validation boolean flag determines if ssl certificate validation +is done. The proxy_info parameter is an object of type :class:ProxyInfo.
+ +
+
+class httplib2.ProxyInfo(proxy_type, proxy_host, proxy_port[, proxy_rdns=None][, proxy_user=None][, proxy_pass=None])
+

Collect information required to use a proxy. +The parameter proxy_type must be set to one of socks.PROXY_TYPE_XXX +constants. For example:

+

p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, proxy_host=’localhost’, proxy_port=8000)

+
+ +
+
+class httplib2.Response(info)
+
Response is a subclass of dict and instances of this class are +returned from calls to Http.request. The info parameter is either an +rfc822.Message or an httplib.HTTPResponse object.
+ +
+
+class httplib2.FileCache(dir_name[, safe=safename])
+
FileCache implements a Cache as a directory of files. The dir_name parameter +is the name of the directory to use. If the directory does not exist then +FileCache attempts to create the directory. The optional safe parameter is a +funtion which generates the cache filename for each URI. A FileCache object is +constructed and used for caching when you pass a directory name into the +constructor of Http.
+ +

Http objects have the following methods:

+
+

Http Objects

+
+
+Http.request(uri[, method="GET", body=None, headers=None, redirections=DEFAULT_MAX_REDIRECTS, connection_type=None])
+

Performs a single HTTP request. The uri is the URI of the HTTP resource and +can begin with either http or https. The value of uri must be an +absolute URI.

+

The method is the HTTP method to perform, such as GET, POST, +DELETE, etc. There is no restriction on the methods allowed.

+

The body is the entity body to be sent with the request. It is a string +object.

+

Any extra headers that are to be sent with the request should be provided in the +headers dictionary.

+

The maximum number of redirect to follow before raising an exception is +redirections. The default is 5.

+

The connection_type is the type of connection object to use. The supplied +class should implement the interface of httplib.HTTPConnection.

+

The return value is a tuple of (response, content), the first being and instance +of the Response class, the second being a string that contains the +response entity body.

+
+ +
+
+Http.add_credentials(name, password[, domain=None])
+
Adds a name and password that will be used when a request requires +authentication. Supplying the optional domain name will restrict these +credentials to only be sent to the specified domain. If domain is not +specified then the given credentials will be used to try to satisfy every HTTP +401 challenge.
+ +
+
+Http.add_certificate(key, cert, domain)
+
Add a key and cert that will be used for an SSL connection to the specified +domain. keyfile is the name of a PEM formatted file that contains your +private key. certfile is a PEM formatted certificate chain file.
+ +
+
+Http.clear_credentials()
+
Remove all the names and passwords used for authentication.
+ +
+
+Http.follow_redirects
+
If True, which is the default, safe redirects are followed, where safe means +that the client is only doing a GET or HEAD on the URI to which it is +being redirected. If False then no redirects are followed. Note that a False +‘follow_redirects’ takes precedence over a True ‘follow_all_redirects’. Another +way of saying that is for ‘follow_all_redirects’ to have any affect, +‘follow_redirects’ must be True.
+ +
+
+Http.follow_all_redirects
+
If False, which is the default, only safe redirects are followed, where safe +means that the client is only doing a GET or HEAD on the URI to which it +is being redirected. If True then all redirects are followed. Note that a +False ‘follow_redirects’ takes precedence over a True ‘follow_all_redirects’. +Another way of saying that is for ‘follow_all_redirects’ to have any affect, +‘follow_redirects’ must be True.
+ +
+
+Http.forward_authorization_headers
+
If False, which is the default, then Authorization: headers are +stripped from redirects. If True then Authorization: headers are left +in place when following redirects. This parameter only applies if following +redirects is turned on. Note that turning this on could cause your credentials +to leak, so carefully consider the consequences.
+ +
+
+Http.force_exception_to_status_code
+

If True then no httplib2 exceptions will be +thrown. Instead, those error conditions will be turned into Response +objects that will be returned normally.

+

If False, which is the default, then exceptions will be thrown.

+
+ +
+
+Http.optimistic_concurrency_methods
+
By default a list that only contains “PUT”, this attribute +controls which methods will get ‘if-match’ headers attached +to them from cached responses with etags. You can append +new items to this list to add new methods that should +get this support, such as “PATCH”.
+ +
+
+Http.ignore_etag
+
Defaults to False. If True, then any etags present in the cached +response are ignored when processing the current request, i.e. httplib2 does +not use ‘if-match’ for PUT or ‘if-none-match’ when GET or HEAD requests are +made. This is mainly to deal with broken servers which supply an etag, but +change it capriciously.
+ +

If you wish to supply your own caching implementation then you will need to pass +in an object that supports the following methods. Note that the memcache +module supports this interface natively.

+
+
+

Cache Objects

+
+
+Cache.get(key)
+
Takes a string key and returns the value as a string.
+ +
+
+Cache.set(key, value)
+
Takes a string key and value and stores it in the cache.
+ +
+
+Cache.delete(key)
+
Deletes the cached value stored at key. The value of key is a string.
+ +

Response objects are derived from dict and map header names (lower case +with the trailing colon removed) to header values. In addition to the dict +methods a Response object also has:

+
+
+

Response Objects

+
+
+Response.fromcache
+
If true the the response was returned from the cache.
+ +
+
+Response.version
+
The version of HTTP that the server supports. A value of 11 means ‘1.1’.
+ +
+
+Response.status
+
The numerical HTTP status code returned in the response.
+ +
+
+Response.reason
+
The human readable component of the HTTP response status code.
+ +
+
+Response.previous
+
If redirects are followed then the Response object returned is just for +the very last HTTP request and previous points to the previous +Response object. In this manner they form a chain going back through +the responses to the very first response. Will be None if there are no +previous respones.
+ +

The Response object also populates the header content-location, that +contains the URI that was ultimately requested. This is useful if redirects were +encountered, you can determine the ultimate URI that the request was sent to. +All Response objects contain this key value, including previous responses so +you can determine the entire chain of redirects. If +Http.force_exception_to_status_code is True and the number of +redirects has exceeded the number of allowed number of redirects then the +Response object will report the error in the status code, but the +complete chain of previous responses will still be in tact.

+

To do a simple GET request just supply the absolute URI of the resource:

+
+
+

Examples

+
import httplib2
+h = httplib2.Http()
+resp, content = h.request("http://bitworking.org/")
+assert resp.status == 200
+assert resp['content-type'] == 'text/html'
+
+
+

Here is more complex example that does a PUT of some text to a resource that +requires authentication. The Http instance also uses a file cache in the +directory .cache.

+
import httplib2
+h = httplib2.Http(".cache")
+h.add_credentials('name', 'password')
+resp, content = h.request("https://example.org/chap/2",
+    "PUT", body="This is text",
+    headers={'content-type':'text/plain'} )
+
+
+

Here is an example that connects to a server that supports the Atom Publishing +Protocol.

+
import httplib2
+h = httplib2.Http()
+h.add_credentials(myname, mypasswd)
+h.follow_all_redirects = True
+headers = {'Content-Type': 'application/atom+xml'}
+body    = """<?xml version="1.0" ?>
+    <entry xmlns="http://www.w3.org/2005/Atom">
+      <title>Atom-Powered Robots Run Amok</title>
+      <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
+      <updated>2003-12-13T18:30:02Z</updated>
+      <author><name>John Doe</name></author>
+      <content>Some text.</content>
+</entry>
+"""
+uri     = "http://www.example.com/collection/"
+resp, content = h.request(uri, "POST", body=body, headers=headers)
+
+
+

Here is an example of providing data to an HTML form processor. In this case we +presume this is a POST form. We need to take our data and format it as +“application/x-www-form-urlencoded” data and use that as a body for a POST +request.

+
>>> import httplib2
+>>> import urllib
+>>> data = {'name': 'fred', 'address': '123 shady lane'}
+>>> body = urllib.urlencode(data)
+>>> body
+'name=fred&address=123+shady+lane'
+>>> h = httplib2.Http()
+>>> resp, content = h.request("http://example.com", method="POST", body=body)
+
+
+
+
+ + +
+
+
+
+
+

Table Of Contents

+ + +

Previous topic

+

The httplib2 Library

+

This Page

+ + + +
+
+
+
+ + + + diff -Nru python-httplib2-0.8/doc/html/modindex.html python-httplib2-0.9+dfsg/doc/html/modindex.html --- python-httplib2-0.8/doc/html/modindex.html 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/modindex.html 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,104 @@ + + + + + + + Global Module Index — httplib2 v0.4 documentation + + + + + + + + + + + + + + + +
+
+
+
+ + +

Global Module Index

+ H +
+ + + + + +
 
H
+ httplib2 +
+ + +
+
+
+
+
+ + +
+
+
+
+ + + + diff -Nru python-httplib2-0.8/doc/html/objects.inv python-httplib2-0.9+dfsg/doc/html/objects.inv --- python-httplib2-0.8/doc/html/objects.inv 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/objects.inv 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,36 @@ +# Sphinx inventory version 1 +# Project: httplib2 +# Version: 0.4 +httplib2 mod libhttplib2.html +httplib2.ProxyInfo class libhttplib2.html +httplib2.Cache.set method libhttplib2.html +httplib2.Http class libhttplib2.html +httplib2.Cache.delete method libhttplib2.html +httplib2.Http.follow_all_redirects attribute libhttplib2.html +httplib2.RelativeURIError exception libhttplib2.html +httplib2.Http.follow_redirects attribute libhttplib2.html +httplib2.RETRIES data libhttplib2.html +httplib2.debuglevel data libhttplib2.html +httplib2.FileCache class libhttplib2.html +httplib2.RedirectMissingLocation exception libhttplib2.html +httplib2.Http.add_certificate method libhttplib2.html +httplib2.Http.add_credentials method libhttplib2.html +httplib2.Response.reason attribute libhttplib2.html +httplib2.Http.clear_credentials method libhttplib2.html +httplib2.Cache.get method libhttplib2.html +httplib2.Http.forward_authorization_headers attribute libhttplib2.html +httplib2.Http.optimistic_concurrency_methods attribute libhttplib2.html +httplib2.RedirectLimit exception libhttplib2.html +httplib2.ServerNotFoundError exception libhttplib2.html +httplib2.Response class libhttplib2.html +httplib2.Http.request method libhttplib2.html +httplib2.Http.force_exception_to_status_code attribute libhttplib2.html +httplib2.HttpLib2Error exception libhttplib2.html +httplib2.Response.fromcache attribute libhttplib2.html +httplib2.UnimplementedHmacDigestAuthOptionError exception libhttplib2.html +httplib2.Http.ignore_etag attribute libhttplib2.html +httplib2.UnimplementedDigestAuthOptionError exception libhttplib2.html +httplib2.FailedToDecompressContent exception libhttplib2.html +httplib2.Response.status attribute libhttplib2.html +httplib2.Response.version attribute libhttplib2.html +httplib2.Response.previous attribute libhttplib2.html diff -Nru python-httplib2-0.8/doc/html/search.html python-httplib2-0.9+dfsg/doc/html/search.html --- python-httplib2-0.8/doc/html/search.html 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/search.html 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,98 @@ + + + + + + + Search — httplib2 v0.4 documentation + + + + + + + + + + + +
+
+
+
+ +

Search

+
+ +

+ Please activate JavaScript to enable the search + functionality. +

+
+

+ From here you can search these documents. Enter your search + words into the box below and click "search". Note that the search + function will automatically search for all of the words. Pages + containing fewer words won't appear in the result list. +

+
+ + + +
+ +
+ +
+ +
+
+
+
+
+
+
+
+
+ + + + + + + diff -Nru python-httplib2-0.8/doc/html/searchindex.json python-httplib2-0.9+dfsg/doc/html/searchindex.json --- python-httplib2-0.8/doc/html/searchindex.json 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/searchindex.json 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1 @@ +[["index","libhttplib2"],["The httplib2 Library","httplib2 A comprehensive HTTP client library."],{"all":[1],"code":[1],"chain":[1],"suno":[1],"go":[1],"follow":[1],"privat":[1],"tt":[1],"readabl":[1],"to":[0,1],"those":[1],"sent":[1],"liter":[1],"everi":[1],"string":[1],"fals":[1],"unfamiliar":[1],"veri":[1],"affect":[1],"force_exception_to_status_cod":[1],"level":[1],"list":[1],"try":[1],"item":[1],"refer":[1],"pleas":[1],"impli":[1],"direct":[0],"tex":[1],"second":[1],"pass":[1],"13t18":[1],"append":[1],"even":[1],"index":[0,1],"what":[1],"section":[1],"current":[1],"delet":[1],"version":[1],"new":[1],"public":[1],"funtion":[1],"redirect":[0,1],"deriv":[1],"gener":[1],"here":[1],"bodi":[1],"address":[1],"redirectmissingloc":[1],"ignore_etag":[1],"standard":[1],"modifi":[1],"valu":[1],"refmodindex":[1],"search":[0],"respon":[1],"30":[1],"memcach":[1],"portabl":[1],"amount":[1],"excdesc":[1],"implement":[1],"macintosh":[1],"extra":[1],"appli":[1],"modul":[0,1],"keyfil":[1],"filenam":[1],"unix":[1],"kei":[1],"from":[1],"describ":[1],"0":[0,1],"mydir":[1],"by":[0,1],"massag":[1],"call":[1],"type":[1],"more":[1],"flat":[1],"python":[1],"trail":[1],"indic":[0,1],"known":[1],"cach":[0,1],"must":[1],"none":[1],"hmacdigest":[1],"optimistic_concurrency_method":[1],"unimplementedhmacdigestauthoptionerror":[1],"can":[0,1],"root":[0],"aliv":[0,1],"uncom":[1],"control":[1],"claim":[1],"quickstart":[0],"give":[1],"process":[1],"challeng":[1],"templat":[1],"aaaa":[1],"sourc":[1],"onlin":[1],"phrase":[1],"occur":[1],"multipl":[1],"hoc":[1],"anoth":[1],"1":[1],"instead":[1],"simpl":[1],"unabl":[1],"map":[1],"mar":[0],"resourc":[1],"after":[1],"tact":[1],"befor":[1],"mac":[1],"date":[0],"such":[1],"underscor":[1],"data":[1],"unreserv":[1],"a":[0,1],"short":[1],"attempt":[1],"ssl":[1],"credenti":[1],"robot":[1],"or":[1],"inform":[1],"preced":[1],"so":[1],"allow":[1],"shadi":[1],"over":[1],"becaus":[1],"3xx":[1],"through":[1],"still":[1],"mainli":[1],"digest":[1],"paramet":[1],"27":[0],"uuid":[1],"platform":[1],"window":[1],"html":[1],"401":[1],"comprehens":[0,1],"then":[1],"them":[1],"failedtodecompresscont":[1],"return":[1],"thei":[1],"handl":[0,1],"safe":[1],"mention":[1],"httplib2":[0,1],"not":[1],"now":[1],"gregorio":[0],"80da344efa6a":[1],"httplib":[1],"name":[1],"edit":[1],"authent":[0,1],"separ":[1],"timeout":[1],"each":[1],"debug":[1],"found":[1],"updat":[1],"mean":[1],"compil":[1],"domain":[1],"follow_redirect":[1],"meta":[1],"connect":[1],"our":[1],"variabl":[1],"urlencod":[1],"publish":[1],"content":[0,1],"method":[1],"etag":[1],"adapt":[0],"rel":[1],"debuglevel":[1],"print":[1],"fred":[1],"reason":[1],"base":[1],"dictionari":[1],"put":[1],"org":[1],"thrown":[1],"omit":[1],"keep":[0,1],"turn":[1],"isn":[1],"principl":[1],"caprici":[1],"first":[1],"oper":[1],"there":[1],"certfil":[1],"directli":[1],"onc":[1],"number":[1],"restrict":[1],"mai":[1],"instruct":[1],"alreadi":[1],"least":[0,1],"blank":[1],"oppos":[1],"open":[1],"given":[1],"sometim":[1],"messag":[1],"attach":[1],"2":[1],"master":[0],"statement":[1],"john":[1],"final":[1],"store":[1],"xmln":[1],"option":[1],"that":[0,1],"tool":[1],"copi":[1],"specifi":[1],"cfb8":[1],"part":[1],"checkout":[1],"than":[1],"httplib2error":[1],"kind":[0],"12":[1],"14":[0],"16":[0],"provid":[1],"remov":[1],"were":[1],"markup":[1],"pre":[1],"sai":[1],"arg":[1],"argument":[1],"manner":[1],"have":[1],"tabl":[0],"need":[1],"classdesc":[1],"built":[1],"lib":[1],"client":[0,1],"note":[1],"also":[1],"without":[1],"take":[1],"which":[1],"environ":[1],"singl":[1],"simplifi":[1],"begin":[1],"normal":[1],"object":[0,1],"reach":[1],"class":[1],"07":[0],"latex":[1],"doc":[1],"urn":[1],"request":[1],"uri":[1],"doe":[1],"determin":[1],"text":[1],"unimplementeddigestauthoptionerror":[1],"xml":[1],"absolut":[1],"onli":[1],"locat":[1],"modnam":[1],"with":[1],"written":[1],"should":[0,1],"dict":[1],"8":[0],"do":[1],"bitwork":[1],"get":[1],"filecach":[1],"nativ":[1],"123":[1],"report":[1],"requir":[1],"h":[1],"whenev":[1],"patch":[1],"stuff":[1],"contain":[0,1],"x":[1],"attribut":[1],"where":[1],"certif":[1],"set":[1],"we":[1],"see":[1],"w3":[1],"respons":[0,1],"fail":[1],"statu":[1],"detect":[1],"wa":[1],"urllib":[1],"3":[1],"import":[1],"entiti":[1],"mynam":[1],"altern":[1],"accord":[1],"extend":[1],"numer":[1],"entir":[1],"joe":[0],"come":[1],"addit":[1],"both":[1],"c":[1],"last":[1],"etc":[1],"s":[1],"instanc":[1],"mani":[0],"com":[1],"comment":[1],"and":[0,1],"point":[1],"overview":[1],"header":[1],"colon":[1],"prologu":[1],"ultim":[1],"three":[1],"been":[1],"compon":[1],"basic":[1],"popul":[1],"4":[0,1],"ani":[1],"assert":[1],"understand":[1],"an":[1],"present":[1],"case":[1],"these":[1],"plain":[1],"as":[1],"will":[1],"defin":[1],"error":[1],"02z":[1],"4ebb":[1],"subsect":[1],"dir_nam":[1],"fill":[1],"is":[0,1],"it":[0,1],"mypasswd":[1],"good":[1],"follow_all_redirect":[1],"in":[1],"id":[1],"if":[1],"author":[0,1],"perform":[1],"insofar":[1],"satisfi":[1],"cert":[1],"same":[1],"member":[1],"add_certif":[1],"complex":[1],"document":[0,1],"complet":[0,1],"http":[0,1],"rfc822":[1],"mytyp":[1],"decompress":[1],"rais":[1],"user":[1],"chang":[1],"lower":[1],"appropri":[1],"i":[1],"entri":[1],"thu":[0],"exampl":[0,1],"add_credenti":[1],"thi":[0,1],"choos":[1],"gzip":[1],"the":[0,1],"refstmodindex":[1],"construct":[1],"protocol":[1],"declaremodul":[1],"just":[1],"resp":[1],"human":[1],"flavor":[1],"httprespons":[1],"except":[1],"add":[1],"valid":[1],"funcdesc":[1],"match":[1],"applic":[1],"format":[1],"safenam":[1],"password":[1],"you":[0,1],"connection_typ":[1],"redirectlimit":[1],"like":[0,1],"specif":[1],"servernotfounderror":[1],"docutil":[1],"manual":[1],"resolv":[1],"server":[1],"collect":[1],"either":[1],"amok":[1],"page":[0],"encount":[1],"www":[1],"deal":[1],"200":[1],"suppli":[1],"some":[1],"back":[1],"mod_nam":[1],"toctre":[0],"datadesc":[1],"librari":[0,1],"clear_credenti":[1],"for":[1],"subclass":[1],"pem":[1],"leav":[1],"condit":[1],"t":[1],"be":[1],"previou":[1],"run":[1],"power":[1],"compress":[0,1],"broken":[1],"host":[1],"refbimodindex":[1],"post":[1],"refexmodindex":[1],"on":[0,1],"deflat":[1],"socket":[1],"of":[0,1],"irix":[1],"default_max_redirect":[1],"fromcach":[1],"constructor":[1],"produc":[1],"block":[1],"own":[1],"into":[1],"exceed":[1],"automat":[1],"your":[0,1],"processor":[1],"span":[1],"wai":[1],"support":[1],"memberdesc":[1],"avail":[1],"lost":[1],"interfac":[1],"includ":[1],"lot":[1],"function":[1],"head":[1],"form":[1],"tupl":[1],"but":[0,1],"atom":[1],"sphinx":[0],"line":[1],"ha":[1],"true":[1],"info":[1],"made":[1],"possibl":[1],"default":[1],"wish":[1],"maximum":[1],"us":[1],"below":[1],"problem":[1],"1225c695":[1],"httpconnect":[1],"featur":[1],"ad":[1],"creat":[0,1],"abstract":[0],"repres":[1],"chap":[1],"ar":[1],"exist":[1],"at":[0,1],"file":[0,1],"relativeurierror":[1],"methoddesc":[1],"probabl":[1],"11":[1],"no":[1],"titl":[1],"when":[1],"detail":[1],"other":[1],"5":[1],"presum":[1],"time":[1],"mymodul":[1],"lane":[1],"e":[1],"algorithm":[1],"directori":[1],"2003":[1],"wsse":[1],"ignor":[1],"2007":[0],"2005":[1],"2008":[0]}] \ No newline at end of file diff -Nru python-httplib2-0.8/doc/html/_sources/index.txt python-httplib2-0.9+dfsg/doc/html/_sources/index.txt --- python-httplib2-0.8/doc/html/_sources/index.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/_sources/index.txt 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,35 @@ +.. httplib2 documentation master file, created by sphinx-quickstart on Thu Mar 27 16:07:14 2008. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +************************ + The httplib2 Library +************************ + +:Author: Joe Gregorio + +:Date: Mar 8, 2007 + +.. |release| replace:: 0.4 + + +.. topic:: Abstract + + The :mod:`httplib2` module is a comprehensive HTTP client library that handles + caching, keep-alive, compression, redirects and many kinds of authentication. + + +Contents: + +.. toctree:: + :maxdepth: 2 + + libhttplib2.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff -Nru python-httplib2-0.8/doc/html/_sources/libhttplib2.txt python-httplib2-0.9+dfsg/doc/html/_sources/libhttplib2.txt --- python-httplib2-0.8/doc/html/_sources/libhttplib2.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/_sources/libhttplib2.txt 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,483 @@ +.. % Template for a library manual section. +.. % PLEASE REMOVE THE COMMENTS AFTER USING THE TEMPLATE +.. % +.. % Complete documentation on the extended LaTeX markup used for Python +.. % documentation is available in ``Documenting Python'', which is part +.. % of the standard documentation for Python. It may be found online +.. % at: +.. % +.. % http://www.python.org/doc/current/doc/doc.html +.. % ==== 0. ==== +.. % Copy this file to /lib.tex, and edit that file +.. % according to the instructions below. + +.. % ==== 1. ==== +.. % The section prologue. Give the section a title and provide some +.. % meta-information. References to the module should use +.. % \refbimodindex, \refstmodindex, \refexmodindex or \refmodindex, as +.. % appropriate. + + +:mod:`httplib2` A comprehensive HTTP client library. +===================================================== + +.. module:: httplib2 +.. moduleauthor:: Joe Gregorio +.. sectionauthor:: Joe Gregorio + + +.. % Choose one of these to specify the module module name. If there's +.. % an underscore in the name, use +.. % \declaremodule[modname]{...}{mod_name} instead. +.. % +.. % not standard, in Python +.. % Portability statement: Uncomment and fill in the parameter to specify the +.. % availability of the module. The parameter can be Unix, IRIX, SunOS, Mac, +.. % Windows, or lots of other stuff. When ``Mac'' is specified, the availability +.. % statement will say ``Macintosh'' and the Module Index may say ``Mac''. +.. % Please use a name that has already been used whenever applicable. If this +.. % is omitted, no availability statement is produced or implied. +.. % +.. % \platform{Unix} +.. % These apply to all modules, and may be given more than once: +.. % Author of the module code; +.. % omit if not known. +.. % Author of the documentation, +.. % even if not a module section. + + + +.. % Leave at least one blank line after this, to simplify ad-hoc tools +.. % that are sometimes used to massage these files. + +The :mod:`httplib2` module is a comprehensive HTTP client library with the +following features: + +.. % ==== 2. ==== +.. % Give a short overview of what the module does. +.. % If it is platform specific, mention this. +.. % Mention other important restrictions or general operating principles. +.. % For example: + +.. describe:: HTTP and HTTPS + + HTTPS support is only available if the socket module was compiled with SSL + support. + +.. describe:: Keep-Alive + + Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple + requests over the same connection if possible. + +.. describe:: Authentication + + The following three types of HTTP Authentication are supported. These can be + used over both HTTP and HTTPS. + + * Digest + * Basic + * WSSE + +.. describe:: Caching + + The module can optionally operate with a private cache that understands the + Cache-Control: header and uses both the ETag and Last-Modified cache validators. + +.. describe:: All Methods + + The module can handle any HTTP request method, not just GET and POST. + +.. describe:: Redirects + + Automatically follows 3XX redirects on GETs. + +.. describe:: Compression + + Handles both ``deflate`` and ``gzip`` types of compression. + +.. describe:: Lost update support + + Automatically adds back ETags into PUT requests to resources we have already + cached. This implements Section 3.2 of Detecting the Lost Update Problem Using + Unreserved Checkout + +The :mod:`httplib2` module defines the following variables: + +.. % ==== 3. ==== +.. % List the public functions defined by the module. Begin with a +.. % standard phrase. You may also list the exceptions and other data +.. % items defined in the module, insofar as they are important for the +.. % user. +.. % ---- 3.2. ---- +.. % Data items are described using a ``datadesc'' block. This has only +.. % one parameter: the item's name. + + +.. data:: debuglevel + + The amount of debugging information to print. The default is 0. + + +.. data:: RETRIES + + A request will be tried 'RETRIES' times if it fails at the socket/connection level. + The default is 2. + +The :mod:`httplib2` module may raise the following Exceptions. Note that there +is an option that turns exceptions into normal responses with an HTTP status +code indicating an error occured. See +:attr:`Http.force_exception_to_status_code` + +.. % --- 3.3. --- +.. % Exceptions are described using a ``excdesc'' block. This has only +.. % one parameter: the exception name. Exceptions defined as classes in +.. % the source code should be documented using this environment, but +.. % constructor parameters must be omitted. + + +.. exception:: HttpLib2Error + + The Base Exception for all exceptions raised by httplib2. + + +.. exception:: RedirectMissingLocation + + A 3xx redirect response code was provided but no Location: header was provided + to point to the new location. + + +.. exception:: RedirectLimit + + The maximum number of redirections was reached without coming to a final URI. + + +.. exception:: ServerNotFoundError + + Unable to resolve the host name given. + + +.. exception:: RelativeURIError + + A relative, as opposed to an absolute URI, was passed into request(). + + +.. exception:: FailedToDecompressContent + + The headers claimed that the content of the response was compressed but the + decompression algorithm applied to the content failed. + + +.. exception:: UnimplementedDigestAuthOptionError + + The server requested a type of Digest authentication that we are unfamiliar + with. + + +.. exception:: UnimplementedHmacDigestAuthOptionError + + The server requested a type of HMACDigest authentication that we are unfamiliar + with. + +.. % ---- 3.4. ---- +.. % Other standard environments: +.. % +.. % classdesc - Python classes; same arguments are funcdesc +.. % methoddesc - methods, like funcdesc but has an optional parameter +.. % to give the type name: \begin{methoddesc}[mytype]{name}{args} +.. % By default, the type name will be the name of the +.. % last class defined using classdesc. The type name +.. % is required if the type is implemented in C (because +.. % there's no classdesc) or if the class isn't directly +.. % documented (if it's private). +.. % memberdesc - data members, like datadesc, but with an optional +.. % type name like methoddesc. + + +.. class:: Http([cache=None], [timeout=None], [proxy_info==ProxyInfo.from_environment], [ca_certs=None], [disable_ssl_certificate_validation=False]) + + The class that represents a client HTTP interface. The *cache* parameter is + either the name of a directory to be used as a flat file cache, or it must an + object that implements the required caching interface. The *timeout* parameter + is the socket level timeout. The *ca_certs* parameter is the filename of the + CA certificates to use. If none is given a default set is used. The + *disable_ssl_certificate_validation* boolean flag determines if ssl certificate validation + is done. The *proxy_info* parameter is an object of type :class:ProxyInfo. + + +.. class:: ProxyInfo(proxy_type, proxy_host, proxy_port, [proxy_rdns=None], [proxy_user=None], [proxy_pass=None]) + + Collect information required to use a proxy. + The parameter proxy_type must be set to one of socks.PROXY_TYPE_XXX + constants. For example: :: + + p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, proxy_host='localhost', proxy_port=8000) + +.. class:: Response(info) + + Response is a subclass of :class:`dict` and instances of this class are + returned from calls to Http.request. The *info* parameter is either an + :class:`rfc822.Message` or an :class:`httplib.HTTPResponse` object. + + +.. class:: FileCache(dir_name, [safe=safename]) + + FileCache implements a Cache as a directory of files. The *dir_name* parameter + is the name of the directory to use. If the directory does not exist then + FileCache attempts to create the directory. The optional *safe* parameter is a + funtion which generates the cache filename for each URI. A FileCache object is + constructed and used for caching when you pass a directory name into the + constructor of :class:`Http`. + +Http objects have the following methods: + +.. % If your module defines new object types (for a built-in module) or +.. % classes (for a module written in Python), you should list the +.. % methods and instance variables (if any) of each type or class in a +.. % separate subsection. + +.. _http-objects: + +Http Objects +--------------- + +.. method:: Http.request(uri, [method="GET", body=None, headers=None, redirections=DEFAULT_MAX_REDIRECTS, connection_type=None]) + + Performs a single HTTP request. The *uri* is the URI of the HTTP resource and + can begin with either ``http`` or ``https``. The value of *uri* must be an + absolute URI. + + The *method* is the HTTP method to perform, such as ``GET``, ``POST``, + ``DELETE``, etc. There is no restriction on the methods allowed. + + The *body* is the entity body to be sent with the request. It is a string + object. + + Any extra headers that are to be sent with the request should be provided in the + *headers* dictionary. + + The maximum number of redirect to follow before raising an exception is + *redirections*. The default is 5. + + The *connection_type* is the type of connection object to use. The supplied + class should implement the interface of httplib.HTTPConnection. + + The return value is a tuple of (response, content), the first being and instance + of the :class:`Response` class, the second being a string that contains the + response entity body. + + +.. method:: Http.add_credentials(name, password, [domain=None]) + + Adds a name and password that will be used when a request requires + authentication. Supplying the optional *domain* name will restrict these + credentials to only be sent to the specified domain. If *domain* is not + specified then the given credentials will be used to try to satisfy every HTTP + 401 challenge. + + +.. method:: Http.add_certificate(key, cert, domain) + + Add a *key* and *cert* that will be used for an SSL connection to the specified + domain. *keyfile* is the name of a PEM formatted file that contains your + private key. *certfile* is a PEM formatted certificate chain file. + + +.. method:: Http.clear_credentials() + + Remove all the names and passwords used for authentication. + + +.. attribute:: Http.follow_redirects + + If ``True``, which is the default, safe redirects are followed, where safe means + that the client is only doing a ``GET`` or ``HEAD`` on the URI to which it is + being redirected. If ``False`` then no redirects are followed. Note that a False + 'follow_redirects' takes precedence over a True 'follow_all_redirects'. Another + way of saying that is for 'follow_all_redirects' to have any affect, + 'follow_redirects' must be True. + + +.. attribute:: Http.follow_all_redirects + + If ``False``, which is the default, only safe redirects are followed, where safe + means that the client is only doing a ``GET`` or ``HEAD`` on the URI to which it + is being redirected. If ``True`` then all redirects are followed. Note that a + False 'follow_redirects' takes precedence over a True 'follow_all_redirects'. + Another way of saying that is for 'follow_all_redirects' to have any affect, + 'follow_redirects' must be True. + + +.. attribute:: Http.forward_authorization_headers + + If ``False``, which is the default, then Authorization: headers are + stripped from redirects. If ``True`` then Authorization: headers are left + in place when following redirects. This parameter only applies if following + redirects is turned on. Note that turning this on could cause your credentials + to leak, so carefully consider the consequences. + + +.. attribute:: Http.force_exception_to_status_code + + If ``True`` then no :mod:`httplib2` exceptions will be + thrown. Instead, those error conditions will be turned into :class:`Response` + objects that will be returned normally. + + If ``False``, which is the default, then exceptions will be thrown. + + +.. attribute:: Http.optimistic_concurrency_methods + + By default a list that only contains "PUT", this attribute + controls which methods will get 'if-match' headers attached + to them from cached responses with etags. You can append + new items to this list to add new methods that should + get this support, such as "PATCH". + +.. attribute:: Http.ignore_etag + + Defaults to ``False``. If ``True``, then any etags present in the cached + response are ignored when processing the current request, i.e. httplib2 does + **not** use 'if-match' for PUT or 'if-none-match' when GET or HEAD requests are + made. This is mainly to deal with broken servers which supply an etag, but + change it capriciously. + +If you wish to supply your own caching implementation then you will need to pass +in an object that supports the following methods. Note that the :mod:`memcache` +module supports this interface natively. + + +.. _cache-objects: + +Cache Objects +-------------- + +.. method:: Cache.get(key) + + Takes a string *key* and returns the value as a string. + + +.. method:: Cache.set(key, value) + + Takes a string *key* and *value* and stores it in the cache. + + +.. method:: Cache.delete(key) + + Deletes the cached value stored at *key*. The value of *key* is a string. + +Response objects are derived from :class:`dict` and map header names (lower case +with the trailing colon removed) to header values. In addition to the dict +methods a Response object also has: + + +.. _response-objects: + +Response Objects +------------------ + + +.. attribute:: Response.fromcache + + If ``true`` the the response was returned from the cache. + + +.. attribute:: Response.version + + The version of HTTP that the server supports. A value of 11 means '1.1'. + + +.. attribute:: Response.status + + The numerical HTTP status code returned in the response. + + +.. attribute:: Response.reason + + The human readable component of the HTTP response status code. + + +.. attribute:: Response.previous + + If redirects are followed then the :class:`Response` object returned is just for + the very last HTTP request and *previous* points to the previous + :class:`Response` object. In this manner they form a chain going back through + the responses to the very first response. Will be ``None`` if there are no + previous respones. + +The Response object also populates the header ``content-location``, that +contains the URI that was ultimately requested. This is useful if redirects were +encountered, you can determine the ultimate URI that the request was sent to. +All Response objects contain this key value, including ``previous`` responses so +you can determine the entire chain of redirects. If +:attr:`Http.force_exception_to_status_code` is ``True`` and the number of +redirects has exceeded the number of allowed number of redirects then the +:class:`Response` object will report the error in the status code, but the +complete chain of previous responses will still be in tact. + +To do a simple ``GET`` request just supply the absolute URI of the resource: + +.. % ==== 4. ==== +.. % Now is probably a good time for a complete example. (Alternatively, +.. % an example giving the flavor of the module may be given before the +.. % detailed list of functions.) + +.. _httplib2-example: + +Examples +--------- + +:: + + import httplib2 + h = httplib2.Http() + resp, content = h.request("http://bitworking.org/") + assert resp.status == 200 + assert resp['content-type'] == 'text/html' + +Here is more complex example that does a PUT of some text to a resource that +requires authentication. The Http instance also uses a file cache in the +directory ``.cache``. :: + + import httplib2 + h = httplib2.Http(".cache") + h.add_credentials('name', 'password') + resp, content = h.request("https://example.org/chap/2", + "PUT", body="This is text", + headers={'content-type':'text/plain'} ) + +Here is an example that connects to a server that supports the Atom Publishing +Protocol. :: + + import httplib2 + h = httplib2.Http() + h.add_credentials(myname, mypasswd) + h.follow_all_redirects = True + headers = {'Content-Type': 'application/atom+xml'} + body = """ + + Atom-Powered Robots Run Amok + urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a + 2003-12-13T18:30:02Z + John Doe + Some text. + + """ + uri = "http://www.example.com/collection/" + resp, content = h.request(uri, "POST", body=body, headers=headers) + +Here is an example of providing data to an HTML form processor. In this case we +presume this is a POST form. We need to take our data and format it as +"application/x-www-form-urlencoded" data and use that as a body for a POST +request. + + +:: + + >>> import httplib2 + >>> import urllib + >>> data = {'name': 'fred', 'address': '123 shady lane'} + >>> body = urllib.urlencode(data) + >>> body + 'name=fred&address=123+shady+lane' + >>> h = httplib2.Http() + >>> resp, content = h.request("http://example.com", method="POST", body=body) diff -Nru python-httplib2-0.8/doc/html/_static/basic.css python-httplib2-0.9+dfsg/doc/html/_static/basic.css --- python-httplib2-0.8/doc/html/_static/basic.css 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/_static/basic.css 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,417 @@ +/** + * Sphinx stylesheet -- basic theme + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +img { + border: 0; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 0; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +/* -- other body styles ----------------------------------------------------- */ + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlight { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.refcount { + color: #060; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} Binary files /tmp/DyEhGm8qkm/python-httplib2-0.8/doc/html/_static/contents.png and /tmp/SPHUwbSzZk/python-httplib2-0.9+dfsg/doc/html/_static/contents.png differ diff -Nru python-httplib2-0.8/doc/html/_static/default.css python-httplib2-0.9+dfsg/doc/html/_static/default.css --- python-httplib2-0.8/doc/html/_static/default.css 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/_static/default.css 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,218 @@ +/** + * Sphinx stylesheet -- default theme + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: #eeffcc; + color: #333333; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +tt { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +.warning tt { + background: #efc2c2; +} + +.note tt { + background: #d6d6d6; +} \ No newline at end of file diff -Nru python-httplib2-0.8/doc/html/_static/doctools.js python-httplib2-0.9+dfsg/doc/html/_static/doctools.js --- python-httplib2-0.8/doc/html/_static/doctools.js 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/_static/doctools.js 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,232 @@ +/// XXX: make it cross browser + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger + */ +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {} +} + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +} + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +} + +/** + * small function to check if an array contains + * a given item. + */ +jQuery.contains = function(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == item) + return true; + } + return false; +} + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery.className.has(node.parentNode, className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this) + }); + } + } + return this.each(function() { + highlight(this); + }); +} + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initModIndex(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can savely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlight'); + }); + }, 10); + $('') + .appendTo($('.sidebar .this-page-menu')); + } + }, + + /** + * init the modindex toggle buttons + */ + initModIndex : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + console.log($('tr.cg-' + idnum).toggle()); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('span.highlight').removeClass('highlight'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); Binary files /tmp/DyEhGm8qkm/python-httplib2-0.8/doc/html/_static/file.png and /tmp/SPHUwbSzZk/python-httplib2-0.9+dfsg/doc/html/_static/file.png differ diff -Nru python-httplib2-0.8/doc/html/_static/jquery.js python-httplib2-0.9+dfsg/doc/html/_static/jquery.js --- python-httplib2-0.8/doc/html/_static/jquery.js 1970-01-01 00:00:00.000000000 +0000 +++ python-httplib2-0.9+dfsg/doc/html/_static/jquery.js 2014-04-15 12:53:06.000000000 +0000 @@ -0,0 +1,4376 @@ +/*! + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){ + +var + // Will speed up references to window, and allows munging its name. + window = this, + // Will speed up references to undefined, and allows munging its name. + undefined, + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + // Map over the $ in case of overwrite + _$ = window.$, + + jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + this.context = selector; + return this; + } + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem && elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + var ret = jQuery( elem || [] ); + ret.context = document; + ret.selector = selector; + return ret; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return jQuery( document ).ready( selector ); + + // Make sure that old selector state is passed along + if ( selector.selector && selector.context ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return this.setArray(jQuery.isArray( selector ) ? + selector : + jQuery.makeArray(selector)); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.3.2", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num === undefined ? + + // Return a 'clean' array + Array.prototype.slice.call( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) + ret.selector = this.selector + (this.selector ? " " : "") + selector; + else if ( name ) + ret.selector = this.selector + "." + name + "(" + selector + ")"; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this ); + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( typeof name === "string" ) + if ( value === undefined ) + return this[0] && jQuery[ type || "attr" ]( this[0], name ); + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text !== "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).clone(); + + if ( this[0].parentNode ) + wrap.insertBefore( this[0] ); + + wrap.map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }).append(this); + } + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: [].push, + sort: [].sort, + splice: [].splice, + + find: function( selector ) { + if ( this.length === 1 ) { + var ret = this.pushStack( [], "find", selector ); + ret.length = 0; + jQuery.find( selector, this[0], ret ); + return ret; + } else { + return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + })), "find", selector ); + } + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var html = this.outerHTML; + if ( !html ) { + var div = this.ownerDocument.createElement("div"); + div.appendChild( this.cloneNode(true) ); + html = div.innerHTML; + } + + return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; + } else + return this.cloneNode(true); + }); + + // Copy the events from the original to the clone + if ( events === true ) { + var orig = this.find("*").andSelf(), i = 0; + + ret.find("*").andSelf().each(function(){ + if ( this.nodeName !== orig[i].nodeName ) + return; + + var events = jQuery.data( orig[i], "events" ); + + for ( var type in events ) { + for ( var handler in events[ type ] ) { + jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); + } + } + + i++; + }); + } + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ + return elem.nodeType === 1; + }) ), "filter", selector ); + }, + + closest: function( selector ) { + var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, + closer = 0; + + return this.map(function(){ + var cur = this; + while ( cur && cur.ownerDocument ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { + jQuery.data(cur, "closest", closer); + return cur; + } + cur = cur.parentNode; + closer++; + } + }); + }, + + not: function( selector ) { + if ( typeof selector === "string" ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return this.pushStack( jQuery.unique( jQuery.merge( + this.get(), + typeof selector === "string" ? + jQuery( selector ) : + jQuery.makeArray( selector ) + ))); + }, + + is: function( selector ) { + return !!selector && jQuery.multiFilter( selector, this ).length > 0; + }, + + hasClass: function( selector ) { + return !!selector && this.is( "." + selector ); + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Everything else, we just grab the value + return (elem.value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if ( typeof value === "number" ) + value += ''; + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(value); + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value === undefined ? + (this[0] ? + this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, +i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ), + "slice", Array.prototype.slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + domManip: function( args, table, callback ) { + if ( this[0] ) { + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), + first = fragment.firstChild; + + if ( first ) + for ( var i = 0, l = this.length; i < l; i++ ) + callback.call( root(this[i], first), this.length > 1 || i > 0 ? + fragment.cloneNode(true) : fragment ); + + if ( scripts ) + jQuery.each( scripts, evalScript ); + } + + return this; + + function root( elem, cur ) { + return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; + } + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +function now(){ + return +new Date; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) + continue; + + // Recurse if we're merging object values + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) + target[ name ] = jQuery.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + + // Don't bring in undefined values + else if ( copy !== undefined ) + target[ name ] = copy; + + } + + // Return the modified object + return target; +}; + +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}, + toString = Object.prototype.toString; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || + !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && /\S/.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.support.scriptEval ) + script.appendChild( document.createTextNode( data ) ); + else + script.text = data; + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, length = object.length; + + if ( args ) { + if ( length === undefined ) { + for ( name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( ; i < length; ) + if ( callback.apply( object[ i++ ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( length === undefined ) { + for ( name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames !== undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function( elem, className ) { + return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force, extra ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + + if ( extra === "border" ) + return; + + jQuery.each( which, function() { + if ( !extra ) + val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + if ( extra === "margin" ) + val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; + else + val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + } + + if ( elem.offsetWidth !== 0 ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, Math.round(val)); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret, style = elem.style; + + // We need to handle opacity special in IE + if ( name == "opacity" && !jQuery.support.opacity ) { + ret = jQuery.attr( style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && style && style[ name ] ) + ret = style[ name ]; + + else if ( defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var computedStyle = defaultView.getComputedStyle( elem, null ); + + if ( computedStyle ) + ret = computedStyle.getPropertyValue( name ); + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function( elems, context, fragment ) { + context = context || document; + + // !context.createElement fails in IE with an error but returns typeof 'object' + if ( typeof context.createElement === "undefined" ) + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); + if ( match ) + return [ context.createElement( match[1] ) ]; + } + + var ret = [], scripts = [], div = context.createElement("div"); + + jQuery.each(elems, function(i, elem){ + if ( typeof elem === "number" ) + elem += ''; + + if ( !elem ) + return; + + // Convert html string into DOM nodes + if ( typeof elem === "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and