You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2003/07/24 21:00:47 UTC
cvs commit: httpd-python/test/htdocs tests.py
grisha 2003/07/24 12:00:47
Modified: lib/python/mod_python Cookie.py
Doc modpython4.tex
test/htdocs tests.py
Log:
Renamed getCookie to getCookies, because it returns all cokies, not
one (as opposed to setCookie, which sets one cookie)
Revision Changes Path
1.6 +2 -2 httpd-python/lib/python/mod_python/Cookie.py
Index: Cookie.py
===================================================================
RCS file: /home/cvs/httpd-python/lib/python/mod_python/Cookie.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Cookie.py 1 Jul 2003 20:30:20 -0000 1.5
+++ Cookie.py 24 Jul 2003 19:00:46 -0000 1.6
@@ -375,7 +375,7 @@
req.headers_out.add("Set-Cookie", str(cookie))
-def getCookie(req, Class=Cookie, data=None):
+def getCookies(req, Class=Cookie, data=None):
"""
A shorthand for retrieveing and parsing cookies given
a Cookie class. The class must be one of the classes from
1.39 +11 -11 httpd-python/Doc/modpython4.tex
Index: modpython4.tex
===================================================================
RCS file: /home/cvs/httpd-python/Doc/modpython4.tex,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- modpython4.tex 17 Jul 2003 00:51:46 -0000 1.38
+++ modpython4.tex 24 Jul 2003 19:00:46 -0000 1.39
@@ -1488,12 +1488,12 @@
\begin{notice}
Even though there are official IETF RFC's describing HTTP State
- Management Mechanism using cookies, the de facto standard supported by
- most browsers is the original Netscape specification. Further, true
- compliance with IETF standards is actually incompatible with many
- popular browsers, even those that claim to be RFC-compliant.
- Therefore, this module supports the current common practice, and is
- not fully RFC compliant.
+ Management Mechanism using cookies, the de facto standard supported
+ by most browsers is the original Netscape specification.
+ Furthermore, true compliance with IETF standards is actually
+ incompatible with many popular browsers, even those that claim to be
+ RFC-compliant. Therefore, this module supports the current common
+ practice, and is not fully RFC compliant.
\end{notice}
\begin{seealso}
@@ -1617,15 +1617,15 @@
should not be cached.
\end{funcdesc}
-\begin{funcdesc}{getCookie}{req \optional{, Class, data}}
- This is a convenience function for retrieving a cookie from incoming
+\begin{funcdesc}{getCookies}{req \optional{, Class, data}}
+ This is a convenience function for retrieving cookies from incoming
headers. \var{req} is a mod_python \class{Request}
- object. \var{Class} is a class whose \method{parse} method will be
+ object. \var{Class} is a class whose \method{parse()} method will be
used to parse the cookies, it defaults to \code{Cookie}. \var{Data}
is an optional argument which, if not \code{None}, will be passed as
- the first argument to \method{parse} (This is useful for
+ the first argument to \method{parse()} (This is useful for
\class{signedCookie} and \class{MarshalCookie} which require
- \code{secret} as an additional argument to \method{parse}.
+ \code{secret} as an additional argument to \method{parse}).
\end{funcdesc}
\subsection{Examples\label{pyapi-cookie-example}}
1.31 +4 -4 httpd-python/test/htdocs/tests.py
Index: tests.py
===================================================================
RCS file: /home/cvs/httpd-python/test/htdocs/tests.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- tests.py 14 Jul 2003 20:51:32 -0000 1.30
+++ tests.py 24 Jul 2003 19:00:47 -0000 1.31
@@ -752,7 +752,7 @@
from mod_python import Cookie
- cookies = Cookie.getCookie(req)
+ cookies = Cookie.getCookies(req)
for k in cookies:
Cookie.setCookie(req, cookies[k])
@@ -765,10 +765,10 @@
from mod_python import Cookie
- cookies = Cookie.getCookie(req, Cookie.MarshalCookie, "secret")
+ cookies = Cookie.getCookies(req, Cookie.MarshalCookie, "secret")
for k in cookies:
- Cookie.setCookie(req, cookies[k])
+ Cookie.setCookies(req, cookies[k])
req.write("test ok")