Ñò
ñG“Ic @ s d Z d d k Z d d k Z d d k Z d d k l Z y e Wn# e j
o d d k l Z n Xd d d d g Z d e f d „ ƒ YZ
d e f d
„ ƒ YZ e ƒ Z
d e
f d „ ƒ YZ d e f d „ ƒ YZ h d
d 6Z e d j o d d k Z e i ƒ n d S( sI
Gives a multi-value dictionary object (MultiDict) plus several wrappers
iÿÿÿÿN( t DictMixin( t reversedt MultiDictt UnicodeMultiDictt NestedMultiDictt NoVarsc B s" e Z d Z d „ Z d „ Z e e ƒ Z d „ Z e e ƒ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z d
„ Z
d „ Z d „ Z e Z d
„ Z d „ Z d d „ Z d „ Z d „ Z d d „ Z d „ Z d „ Z d „ Z d „ Z e Z d „ Z d „ Z d „ Z d „ Z RS( s§
An ordered dictionary that can have multiple values for each key.
Adds the methods getall, getone, mixed, and add to the normal
dictionary interface.
c O sË t | ƒ d j o t d ƒ ‚ n | os t | d d ƒ o t | d i ƒ ƒ } n9 t | d d ƒ o | d i ƒ } n t | d ƒ } | | _ n
g | _ | o | i i | i ƒ ƒ n d S( Ni s9 MultiDict can only be called with one positional argumenti t iteritemst items( t lent TypeErrort hasattrt listR R t _itemst extend( t selft argst kwR ( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt __init__ s
c C sC t | t ƒ p t d | i | f ƒ ‚ n | ƒ } | | _ | S( s@
Create a dict that is a view on the given list
s8 %s.view_list(obj) takes only actual list objects, not %r( t
isinstanceR R t __name__R ( t clst lstt obj( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt view_list+ s c C sf | ƒ } | i oO xL | i D]= } | i o | i | i | ƒ q | i | i | i ƒ q Wn | S( s@
Create a dict from a cgi.FieldStorage instance
( R t filenamet addt namet value( R t fsR t field( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt from_fieldstorage: s
c C sB x/ t | i ƒ D] \ } } | | j o | Sq Wt | ƒ ‚ d S( N( R R t KeyError( R t keyt kt v( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt __getitem__J s
c C s; y | | =Wn t j
o n X| i i | | f ƒ d S( N( R R t append( R R R ( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt __setitem__P s
c C s | i i | | f ƒ d S( sL
Add the key and value, not overwriting any previous value.
N( R R$ ( R R R ( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyR W s c C sB g } x5 | i D]* \ } } | | j o | i | ƒ q q W| S( sU
Return a list of all values matching the key (may be an empty list)
( R R$ ( R R t resultR! R" ( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt getall] s
c C s_ | i | ƒ } | p t d | ƒ ‚ n t | ƒ d j o t d | | f ƒ ‚ n | d S( sk
Get one value matching the key, raising a KeyError if multiple
values were found.
s Key not found: %ri s Multiple values match %r: %ri ( R' R R ( R R R" ( ( s3 /usr/lib/python2.6/site-packages/webob/multidict.pyt getoneg s c C sˆ h } h } xu | i ƒ D]g \ } } | | j oD | | j o | | i | ƒ q€ | | | g | |