[Python-checkins] CVS: python/dist/src/Doc/lib liburllib.tex,1.41,1.42

Fred L. Drake fdrake@users.sourceforge.net
Thu, 04 Apr 2002 12:34:39 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv3997

Modified Files:
	liburllib.tex 
Log Message:
The rest of the documentation for manual proxy configuration for a basic
urlopen().
This is part of SF patch #523415.


Index: liburllib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** liburllib.tex	4 Apr 2002 20:09:50 -0000	1.41
--- liburllib.tex	4 Apr 2002 20:34:36 -0000	1.42
***************
*** 19,23 ****
  It defines the following public functions:
  
! \begin{funcdesc}{urlopen}{url\optional{, data}}
  Open a network object denoted by a URL for reading.  If the URL does
  not have a scheme identifier, or if it has \file{file:} as its scheme
--- 19,23 ----
  It defines the following public functions:
  
! \begin{funcdesc}{urlopen}{url\optional{, data\optional{, proxies}}}
  Open a network object denoted by a URL for reading.  If the URL does
  not have a scheme identifier, or if it has \file{file:} as its scheme
***************
*** 85,88 ****
--- 85,105 ----
  information from Internet\index{Internet Config} Config.
  
+ Alternatively, the optional \var{proxies} argument may be used to
+ explicitly specify proxies.  It must be a dictionary mapping scheme
+ names to proxy URLs, where an empty dictionary causes no proxies to be
+ used, and \code{None} (the default value) causes environmental proxy
+ settings to be used as discussed above.  For example:
+ 
+ \begin{verbatim}
+ # Use http://www.someproxy.com:3128 for http proxying
+ proxies = proxies={'http': 'http://www.someproxy.com:3128'}
+ filehandle = urllib.urlopen(some_url, proxies=proxies)
+ # Don't use any proxies
+ filehandle = urllib.urlopen(some_url, proxies={})
+ # Use proxies from environment - both versions are equivalent
+ filehandle = urllib.urlopen(some_url, proxies=None)
+ filehandle = urllib.urlopen(some_url)
+ \end{verbatim} 
+ 
  The \function{urlopen()} function does not support explicit proxy
  specification.  If you need to override environmental proxy settings,
***************
*** 206,210 ****
  The optional \var{proxies} parameter should be a dictionary mapping
  scheme names to proxy URLs, where an empty dictionary turns proxies
! off completely.  Its default value is None, in which case
  environmental proxy settings will be used if present, as discussed in
  the definition of \function{urlopen()}, above.
--- 223,227 ----
  The optional \var{proxies} parameter should be a dictionary mapping
  scheme names to proxy URLs, where an empty dictionary turns proxies
! off completely.  Its default value is \code{None}, in which case
  environmental proxy settings will be used if present, as discussed in
  the definition of \function{urlopen()}, above.
***************
*** 315,319 ****
  return value is a tuple consisting of a local filename and either a
  \class{mimetools.Message} object containing the response headers (for remote
! URLs) or None (for local URLs).  The caller must then open and read the
  contents of \var{filename}.  If \var{filename} is not given and the URL
  refers to a local file, the input filename is returned.  If the URL is
--- 332,336 ----
  return value is a tuple consisting of a local filename and either a
  \class{mimetools.Message} object containing the response headers (for remote
! URLs) or \code{None} (for local URLs).  The caller must then open and read the
  contents of \var{filename}.  If \var{filename} is not given and the URL
  refers to a local file, the input filename is returned.  If the URL is