Module Cookie :: Class BaseCookie
[hide private]
[frames] | no frames]

type BaseCookie

object --+    
         |    
      dict --+
             |
            BaseCookie
Known Subclasses:

Instance Methods [hide private]
 
value_decode(self, val)
real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation.
 
value_encode(self, val)
real_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation.
new empty dictionary

__init__(self, input=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__set(self, key, real_value, coded_value)
Private method for setting a cookie's value
 
__setitem__(self, key, value)
Dictionary style assignment.
 
output(self, attrs=None, header='Set-Cookie:', sep='\r\n')
Return a string suitable for HTTP.
 
__str__(self, attrs=None, header='Set-Cookie:', sep='\r\n')
Return a string suitable for HTTP.
 
__repr__(self)
repr(x)
 
js_output(self, attrs=None)
Return a string suitable for JavaScript.
 
load(self, rawdata)
Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary.
 
__ParseString(self, str, patt=re.compile(r'(?x)(?P<key>[\w\d!#%&\'~_`><@,:/\$\*\+-\.\^\|\)\(...)

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Method Details [hide private]

value_decode(self, val)

 

real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies.

value_encode(self, val)

 

real_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation. The VALUE is the value being assigned. Override this function to modify the behavior of cookies.

__init__(self, input=None)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: dict.__init__
(inherited documentation)

__setitem__(self, key, value)
(Index assignment operator)

 

Dictionary style assignment.

Overrides: dict.__setitem__

__str__(self, attrs=None, header='Set-Cookie:', sep='\r\n')
(Informal representation operator)

 

Return a string suitable for HTTP.

Overrides: object.__str__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: dict.__repr__
(inherited documentation)

load(self, rawdata)

 
Load cookies from a string (presumably HTTP_COOKIE) or
from a dictionary.  Loading cookies from a dictionary 'd'
is equivalent to calling:
    map(Cookie.__setitem__, d.keys(), d.values())