[Python-checkins] CVS: python/dist/src/Doc/lib libcookie.tex,1.4,1.5
Ka-Ping Yee
ping@users.sourceforge.net
Wed, 17 Jan 2001 23:50:20 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv1544/lib
Modified Files:
libcookie.tex
Log Message:
Fix the example (it didn't seem to reflect reality).
Index: libcookie.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcookie.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** libcookie.tex 2001/01/10 19:34:52 1.4
--- libcookie.tex 2001/01/18 07:50:17 1.5
***************
*** 174,179 ****
\subsection{Example \label{cookie-example}}
! The following example demonstrates how to open a can of spam using the
! \module{spam} module.
\begin{verbatim}
--- 174,178 ----
\subsection{Example \label{cookie-example}}
! The following example demonstrates how to use the \module{Cookie} module.
\begin{verbatim}
***************
*** 182,192 ****
>>> C = Cookie.SerialCookie()
>>> C = Cookie.SmartCookie()
! >>> C = Cookie.Cookie() # backwards compatible alias for SmartCookie
>>> C = Cookie.SmartCookie()
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
! >>> C # generate HTTP headers
Set-Cookie: sugar=wafer;
Set-Cookie: fig=newton;
>>> C = Cookie.SmartCookie()
>>> C["rocky"] = "road"
--- 181,194 ----
>>> C = Cookie.SerialCookie()
>>> C = Cookie.SmartCookie()
! >>> C = Cookie.Cookie() # backwards-compatible alias for SmartCookie
>>> C = Cookie.SmartCookie()
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
! >>> print C # generate HTTP headers
Set-Cookie: sugar=wafer;
Set-Cookie: fig=newton;
+ >>> print C.output() # same thing
+ Set-Cookie: sugar=wafer;
+ Set-Cookie: fig=newton;
>>> C = Cookie.SmartCookie()
>>> C["rocky"] = "road"
***************
*** 198,213 ****
>>> C = Cookie.SmartCookie()
>>> C.load("chips=ahoy; vienna=finger") # load from a string (HTTP header)
! >>> C
Set-Cookie: vienna=finger;
Set-Cookie: chips=ahoy;
>>> C = Cookie.SmartCookie()
! >>> C.load('keebler="E=everybody; L=\"Loves\"; fudge=\012;";')
! >>> C
Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;";
>>> C = Cookie.SmartCookie()
>>> C["oreo"] = "doublestuff"
>>> C["oreo"]["path"] = "/"
! >>> C
! Set-Cookie: oreo="doublestuff"; Path=/;
>>> C = Cookie.SmartCookie()
>>> C["twix"] = "none for you"
--- 200,215 ----
>>> C = Cookie.SmartCookie()
>>> C.load("chips=ahoy; vienna=finger") # load from a string (HTTP header)
! >>> print C
Set-Cookie: vienna=finger;
Set-Cookie: chips=ahoy;
>>> C = Cookie.SmartCookie()
! >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
! >>> print C
Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;";
>>> C = Cookie.SmartCookie()
>>> C["oreo"] = "doublestuff"
>>> C["oreo"]["path"] = "/"
! >>> print C
! Set-Cookie: oreo=doublestuff; Path=/;
>>> C = Cookie.SmartCookie()
>>> C["twix"] = "none for you"
***************
*** 221,225 ****
>>> C["string"].value
'seven'
! >>> C
Set-Cookie: number=7;
Set-Cookie: string=seven;
--- 223,227 ----
>>> C["string"].value
'seven'
! >>> print C
Set-Cookie: number=7;
Set-Cookie: string=seven;
***************
*** 231,235 ****
>>> C["string"].value
'seven'
! >>> C
Set-Cookie: number="I7\012.";
Set-Cookie: string="S'seven'\012p1\012.";
--- 233,237 ----
>>> C["string"].value
'seven'
! >>> print C
Set-Cookie: number="I7\012.";
Set-Cookie: string="S'seven'\012p1\012.";
***************
*** 241,245 ****
>>> C["string"].value
'seven'
! >>> C
Set-Cookie: number="I7\012.";
Set-Cookie: string=seven;
--- 243,247 ----
>>> C["string"].value
'seven'
! >>> print C
Set-Cookie: number="I7\012.";
Set-Cookie: string=seven;