Module CookieSmall :: Class SimpleCookie
[show private | hide private]
[frames | no frames]

Class SimpleCookie

UserDict --+    
           |    
  BaseCookie --+
               |
              SimpleCookie

Known Subclasses:
myCookie

SimpleCookie SimpleCookie supports strings as cookie values. When setting the value using the dictionary assignment notation, SimpleCookie calls the builtin str() to convert the value to a string. Values received from HTTP are kept as strings.
Method Summary
  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.
    Inherited from BaseCookie
  __init__(self, input)
  __repr__(self)
  __setitem__(self, key, value)
Dictionary style assignment.
  __str__(self, attrs, header, sep)
Return a string suitable for HTTP.
  js_output(self, attrs)
Return a string suitable for JavaScript.
  load(self, rawdata)
Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary.
  output(self, attrs, header, sep)
Return a string suitable for HTTP.
    Inherited from UserDict
  __cmp__(self, dict)
  __contains__(self, key)
  __delitem__(self, key)
  __getitem__(self, key)
  __len__(self)
  clear(self)
  copy(self)
  fromkeys(cls, iterable, value)
(Class method)
  get(self, key, failobj)
  has_key(self, key)
  items(self)
  iteritems(self)
  iterkeys(self)
  itervalues(self)
  keys(self)
  pop(self, key, *args)
  popitem(self)
  setdefault(self, key, failobj)
  update(self, dict)
  values(self)

Instance Method Details

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.
Overrides:
CookieSmall.BaseCookie.value_decode (inherited documentation)

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.
Overrides:
CookieSmall.BaseCookie.value_encode (inherited documentation)

Generated by Epydoc 2.0 on Sat Feb 7 20:08:05 2004 http://epydoc.sf.net