Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 942

Show
Ignore:
Timestamp:
01/26/06 06:10:21
Author:
rdelon
Message:

Deprecating simpleCookie (use "simple_cookie" instead)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cphttptools.py

    r939 r942  
    5858        self.headers = httptools.HeaderMap() 
    5959        self.headerMap = self.headers # Backward compatibility 
    60         self.simpleCookie = Cookie.SimpleCookie() 
     60        self.simple_cookie = Cookie.SimpleCookie() 
     61        self.simpleCookie = self.simple_cookie # Backward compatibility 
    6162         
    6263        if cherrypy.profiler: 
     
    171172            # Warning: if there is more than one header entry for cookies (AFAIK, 
    172173            # only Konqueror does that), only the last one will remain in headers 
    173             # (but they will be correctly stored in request.simpleCookie). 
     174            # (but they will be correctly stored in request.simple_cookie). 
    174175            self.headers[name] = value 
    175176             
     
    177178            # cookies come on different lines with the same key 
    178179            if name.title() == 'Cookie': 
    179                 self.simpleCookie.load(value) 
     180                self.simple_cookie.load(value) 
    180181         
    181182        # Save original values (in case they get modified by filters) 
     
    379380            "Content-Length": None 
    380381        }) 
    381         self.simpleCookie = Cookie.SimpleCookie() 
     382        self.simple_cookie = Cookie.SimpleCookie() 
     383        self.simpleCookie = self.simple_cookie # Backward compatibility 
    382384     
    383385    def collapse_body(self): 
     
    428430        self.header_list = [item[1] for item in header_list] 
    429431         
    430         cookie = self.simpleCookie.output() 
     432        cookie = self.simple_cookie.output() 
    431433        if cookie: 
    432434            lines = cookie.split("\n") 
  • trunk/cherrypy/filters/sessionfilter.py

    r940 r942  
    118118         
    119119        # Check if request came with a session ID 
    120         if cookie_name in cherrypy.request.simpleCookie: 
     120        if cookie_name in cherrypy.request.simple_cookie: 
    121121            # It did: we mark the data as needing to be loaded 
    122             sess.session_id = cherrypy.request.simpleCookie[cookie_name].value 
     122            sess.session_id = cherrypy.request.simple_cookie[cookie_name].value 
    123123             
    124124            # If using implicit locking, acquire lock 
     
    135135            sess.on_create_session(sess.session_data) 
    136136        # Set response cookie 
    137         cookie = cherrypy.response.simpleCookie 
     137        cookie = cherrypy.response.simple_cookie 
    138138        cookie[cookie_name] = sess.session_id 
    139139        cookie[cookie_name]['path'] = cookie_path 
  • trunk/cherrypy/test/test_core.py

    r917 r942  
    301301     
    302302    def single(self, name): 
    303         cookie = cherrypy.request.simpleCookie[name] 
    304         cherrypy.response.simpleCookie[name] = cookie.value 
     303        cookie = cherrypy.request.simple_cookie[name] 
     304        cherrypy.response.simple_cookie[name] = cookie.value 
    305305     
    306306    def multiple(self, names): 
    307307        for name in names: 
    308             cookie = cherrypy.request.simpleCookie[name] 
    309             cherrypy.response.simpleCookie[name] = cookie.value 
     308            cookie = cherrypy.request.simple_cookie[name] 
     309            cherrypy.response.simple_cookie[name] = cookie.value 
    310310 
    311311class MaxRequestSize(Test): 
  • trunk/docs/book/xml/apireference.xml

    r880 r942  
    4848        </section> 
    4949        <section> 
    50             <title>cherrypy.request.simpleCookie</title> 
     50            <title>cherrypy.request.simple_cookie</title> 
    5151            <para>This attribute is a SimpleCookie instance from the standard library's Cookie module 
    5252            which contains the incoming cookie values from the client.</para> 
     
    156156        </section> 
    157157        <section> 
    158             <title>cherrypy.response.simpleCookie</title> 
     158            <title>cherrypy.response.simple_cookie</title> 
    159159            <para>This attribute is a SimpleCookie instance from the standard library's Cookie 
    160160            module. It contains the outgoing cookie values.</para> 

Hosted by WebFaction

Log in as guest/cpguest to create tickets