Package wtf :: Package app :: Module request :: Class CookieCollection
[hide private]
[frames] | no frames]

Class CookieCollection

source code

object --+
         |
        CookieCollection

Cookies parsed out of the request
Instance Methods [hide private]
 
_SPLIT_ITER(...)
Split iterator
source code
 
__init__(self, cookiestring, codec=None)
Initialization
source code
CookieCollection
__call__(self, codec)
Create a cookie collection with a particular codec
source code
unicode
__getitem__(self, name)
Determine the value of a cookie
source code
iterable
__iter__(self)
Create an iterator over the available cookie names
source code
bool
__contains__(self, name)
Determine whether a particular cookie name was submitted
source code
bool
has_key(self, name)
Determine whether a particular cookie name was submitted
source code
list
keys(self)
Determine the list of all available cookie names
source code
tuple
multi(self, name)
Determine a list of all cookies under that name
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
dict _cookies
Cookie mapping ({'name': ['value', ...], ...})
str _cookiestring
Initial cookie string
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_SPLIT_ITER(...)

source code 
Split iterator

__init__(self, cookiestring, codec=None)
(Constructor)

source code 
Initialization
Parameters:
  • cookiestring (str) - Cookie string out of the request
  • codec (CookieCodecInterface) - Cookie en-/decoder; if None, an identity decoder is used.
Overrides: object.__init__

__call__(self, codec)
(Call operator)

source code 
Create a cookie collection with a particular codec
Parameters:
Returns: CookieCollection
New CookieCollection instance

__getitem__(self, name)
(Indexing operator)

source code 
Determine the value of a cookie
Parameters:
  • name (str) - The cookie name
Returns: unicode
The cookie value
Raises:
  • KeyError - The cookie name does not exist

__iter__(self)

source code 
Create an iterator over the available cookie names
Returns: iterable
Iterator over the names

__contains__(self, name)
(In operator)

source code 
Determine whether a particular cookie name was submitted
Parameters:
  • name (str) - The cookie name to look up
Returns: bool
Is the name available?

has_key(self, name)

source code 
Determine whether a particular cookie name was submitted
Parameters:
  • name (str) - The cookie name to look up
Returns: bool
Is the name available?

keys(self)

source code 
Determine the list of all available cookie names
Returns: list
The cookie name list (['name', ...])

multi(self, name)

source code 
Determine a list of all cookies under that name
Parameters:
  • name (str) - Name of the cookie(s)
Returns: tuple
Tuple of cookie values ((u'value', ...)); maybe empty