[Zope3-checkins] CVS: Zope3/src/zope/publisher - http.py:1.5

Steve Alexander steve@cat-box.net
Sun, 26 Jan 2003 07:11:55 -0500


Update of /cvs-repository/Zope3/src/zope/publisher
In directory cvs.zope.org:/tmp/cvs-serv30181/src/zope/publisher

Modified Files:
	http.py 
Log Message:
Normalised some whitespace.
Replaced an if-then with a dict.setdefault.


=== Zope3/src/zope/publisher/http.py 1.4 => 1.5 ===
--- Zope3/src/zope/publisher/http.py:1.4	Mon Dec 30 21:52:18 2002
+++ Zope3/src/zope/publisher/http.py	Sun Jan 26 07:11:52 2003
@@ -702,10 +702,10 @@
 
     def expireCookie(self, name, **kw):
         'See IHTTPResponse'
-        dict={'max_age':0, 'expires':'Wed, 31-Dec-97 23:59:59 GMT'}
+        dict = {'max_age':0, 'expires':'Wed, 31-Dec-97 23:59:59 GMT'}
         for k, v in kw.items():
-            dict[k]=v
-        cookies=self._cookies
+            dict[k] = v
+        cookies = self._cookies
         if name in cookies:
             # Cancel previous setCookie().
             del cookies[name]
@@ -715,16 +715,13 @@
     def setCookie(self, name, value, **kw):
         'See IHTTPResponse'
 
-        cookies=self._cookies
-        if name in cookies:
-            cookie=cookies[name]
-        else:
-            cookie=cookies[name]={}
+        cookies = self._cookies
+        cookie = cookies.setdefault(name, {})
 
         for k, v in kw.items():
-            cookie[k]=v
+            cookie[k] = v
 
-        cookie['value']=value
+        cookie['value'] = value
 
 
     def setCharset(self, charset=None):