From ffc3d54f917aa2c07bdb0fcd2e51e217c6dbfbcb Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Tue, 19 Feb 2013 15:57:37 -0500 Subject: Fix all whitespace issues. Patch from dhermes@google.com. --- README | 82 +++++++++++++++--------------- doc/html/_sources/libhttplib2.txt | 20 ++++---- doc/html/genindex.html | 20 ++++---- doc/html/index.html | 14 +++--- doc/html/libhttplib2.html | 14 +++--- doc/html/modindex.html | 16 +++--- doc/html/search.html | 20 ++++---- doc/libhttplib2.rst | 20 ++++---- index.html | 34 ++++++------- libhttplib2.tex | 78 ++++++++++++++--------------- python2/httplib2/iri2uri.py | 18 +++---- python3/httplib2/iri2uri.py | 18 +++---- python3/httplib2test.py | 102 +++++++++++++++++++------------------- ref/cache-objects.html | 2 +- ref/http-objects.html | 6 +-- ref/httplib2-example.html | 20 ++++---- ref/index.html | 2 +- ref/module-httplib2.html | 32 ++++++------ ref/node2.html | 2 +- ref/ref.html | 2 +- ref/response-objects.html | 2 +- setup.py | 10 ++-- test/conditional-updates/test.cgi | 2 +- test/gzip/post.cgi | 2 +- 24 files changed, 269 insertions(+), 269 deletions(-) mode change 100755 => 100644 README mode change 100755 => 100644 index.html mode change 100755 => 100644 python3/httplib2/iri2uri.py mode change 100755 => 100644 ref/cache-objects.html mode change 100755 => 100644 ref/http-objects.html mode change 100755 => 100644 ref/httplib2-example.html mode change 100755 => 100644 ref/index.html mode change 100755 => 100644 ref/module-httplib2.html mode change 100755 => 100644 ref/node2.html mode change 100755 => 100644 ref/ref.html mode change 100755 => 100644 ref/response-objects.html diff --git a/README b/README old mode 100755 new mode 100644 index 194e7d1..eda7ed2 --- a/README +++ b/README @@ -3,18 +3,18 @@ Httplib2 -------------------------------------------------------------------- Introduction -A comprehensive HTTP client library, httplib2.py supports many +A comprehensive HTTP client library, httplib2.py supports many features left out of other HTTP libraries. HTTP and HTTPS - HTTPS support is only available if the socket module was - compiled with SSL support. + 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. + 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 + The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS. * Digest @@ -22,22 +22,22 @@ Authentication * 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. + 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 + 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 + 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. Unit Tested - A large and growing set of unit tests. + A large and growing set of unit tests. For more information on this module, see: @@ -63,7 +63,7 @@ A simple retrieval: h = httplib2.Http(".cache") (resp_headers, content) = h.request("http://example.org/", "GET") -The 'content' is the content retrieved from the URL. The content +The 'content' is the content retrieved from the URL. The content is already decompressed or unzipped if necessary. To PUT some content to a server that uses SSL and Basic authentication: @@ -71,8 +71,8 @@ To PUT some content to a server that uses SSL and Basic authentication: import httplib2 h = httplib2.Http(".cache") h.add_credentials('name', 'password') - (resp, content) = h.request("https://example.org/chapter/2", - "PUT", body="This is text", + (resp, content) = h.request("https://example.org/chapter/2", + "PUT", body="This is text", headers={'content-type':'text/plain'} ) Use the Cache-Control: header to control how the caching operates. @@ -81,18 +81,18 @@ Use the Cache-Control: header to control how the caching operates. h = httplib2.Http(".cache") (resp, content) = h.request("http://bitworking.org/", "GET") ... - (resp, content) = h.request("http://bitworking.org/", "GET", + (resp, content) = h.request("http://bitworking.org/", "GET", headers={'cache-control':'no-cache'}) -The first request will be cached and since this is a request -to bitworking.org it will be set to be cached for two hours, -because that is how I have my server configured. Any subsequent -GET to that URI will return the value from the on-disk cache -and no request will be made to the server. You can use the -Cache-Control: header to change the caches behavior and in -this example the second request adds the Cache-Control: -header with a value of 'no-cache' which tells the library -that the cached copy must not be used when handling this request. +The first request will be cached and since this is a request +to bitworking.org it will be set to be cached for two hours, +because that is how I have my server configured. Any subsequent +GET to that URI will return the value from the on-disk cache +and no request will be made to the server. You can use the +Cache-Control: header to change the caches behavior and in +this example the second request adds the Cache-Control: +header with a value of 'no-cache' which tells the library +that the cached copy must not be used when handling this request. -------------------------------------------------------------------- @@ -100,23 +100,23 @@ Httplib2 Software License Copyright (c) 2006 by Joe Gregorio -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/doc/html/_sources/libhttplib2.txt b/doc/html/_sources/libhttplib2.txt index d8e33d0..a407bfe 100644 --- a/doc/html/_sources/libhttplib2.txt +++ b/doc/html/_sources/libhttplib2.txt @@ -1,11 +1,11 @@ .. % 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 @@ -29,7 +29,7 @@ .. % 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, @@ -37,7 +37,7 @@ .. % 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; @@ -180,16 +180,16 @@ code indicating an error occured. See .. % ---- 3.4. ---- .. % Other standard environments: -.. % -.. % classdesc - Python classes; same arguments are funcdesc -.. % methoddesc - methods, like funcdesc but has an optional parameter +.. % +.. % 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 +.. % memberdesc - data members, like datadesc, but with an optional .. % type name like methoddesc. @@ -441,8 +441,8 @@ 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", + 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 diff --git a/doc/html/genindex.html b/doc/html/genindex.html index e36d001..0088470 100644 --- a/doc/html/genindex.html +++ b/doc/html/genindex.html @@ -4,7 +4,7 @@ - + Index — httplib2 v0.4 documentation @@ -19,7 +19,7 @@ - + +
- +

Index

- A | C | D | F | G | H | I | O | P | R | S | U | V + A | C | D | F | G | H | I | O | P | R | S | U | V
- +

A

@@ -167,7 +167,7 @@
- + - \ No newline at end of file + diff --git a/doc/html/index.html b/doc/html/index.html index 330adc5..adc081e 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -4,7 +4,7 @@ - + The httplib2 Library — httplib2 v0.4 documentation @@ -20,7 +20,7 @@ - + +
- +

The httplib2 Library

@@ -132,7 +132,7 @@ caching, keep-alive, compression, redirects and many kinds of authentication.

next | -
  • httplib2 v0.4 documentation »
  • +
  • httplib2 v0.4 documentation »
  • - \ No newline at end of file + diff --git a/doc/html/libhttplib2.html b/doc/html/libhttplib2.html index ec9048b..e908a46 100644 --- a/doc/html/libhttplib2.html +++ b/doc/html/libhttplib2.html @@ -4,7 +4,7 @@ - + httplib2 A comprehensive HTTP client library. — httplib2 v0.4 documentation @@ -20,7 +20,7 @@ - + +
    - +

    httplib2 A comprehensive HTTP client library.

    The httplib2 module is a comprehensive HTTP client library with the @@ -478,7 +478,7 @@ request.

  • previous |
  • -
  • httplib2 v0.4 documentation »
  • +
  • httplib2 v0.4 documentation »
  • - \ No newline at end of file + diff --git a/doc/html/modindex.html b/doc/html/modindex.html index 881226a..6c086f9 100644 --- a/doc/html/modindex.html +++ b/doc/html/modindex.html @@ -4,7 +4,7 @@ - + Global Module Index — httplib2 v0.4 documentation @@ -20,7 +20,7 @@ - + - + +
    - +

    Search

    @@ -60,9 +60,9 @@ - +
    - +
    @@ -83,10 +83,10 @@
  • modules |
  • -
  • httplib2 v0.4 documentation »
  • +
  • httplib2 v0.4 documentation »
  • - +
    add_credentials( name, password, [domain=None])
    -Adds a name and password that will be used when a request +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 @@ -108,8 +108,8 @@ be used to try to satisfy every HTTP 401 challenge.
    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. +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.

    diff --git a/ref/httplib2-example.html b/ref/httplib2-example.html old mode 100755 new mode 100644 index 756942b..6607efe --- a/ref/httplib2-example.html +++ b/ref/httplib2-example.html @@ -50,7 +50,7 @@


    -1.1.4 Examples +1.1.4 Examples

    @@ -67,23 +67,23 @@ assert resp['content-type'] == 'text/html'

    -Here is more complex example that does a PUT +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. +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", 
    +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 +Here is an example that connects to a server that supports the Atom Publishing Protocol.

    @@ -108,8 +108,8 @@ 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 +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.

    @@ -142,9 +142,9 @@ r,c = h.request("http://bitworking.org/news/") WIDTH="556" HEIGHT="20" ALIGN="BOTTOM" BORDER="0" SRC="img1.png" ALT="\begin{center}\vbox{\input{modref.ind} -}\end{center}"> +}\end{center}">

    - +