
Rc        	   @` s   d  d k  l Z l Z l Z d  d k l Z y d  d k i i Z	 Wn% e
 j
 o d  d k i i Z	 n Xd e f d     YZ d   Z d   Z d   Z d S(	   i    (   t   absolute_importt   divisiont   unicode_literals(   t
   ModuleTypeNt   MethodDispatcherc           B` s#   e  Z d  Z d d  Z d   Z RS(   up  Dict with 2 special properties:

    On initiation, keys that are lists, sets or tuples are converted to
    multiple keys so accessing any one of the items in the original
    list-like object returns the matching value

    md = MethodDispatcher({("foo", "bar"):"baz"})
    md["foo"] == "baz"

    A default value which can be set through the default attribute.
    c         C` s   g  } xn | D]f \ } } t  |  t t t t f j o( x8 | D] } | i | | f  q? Wq | i | | f  q Wt i |  |  d  |  _	 d  S(   N(
   t   typet   listt   tuplet	   frozensett   sett   appendt   dictt   __init__t   Nonet   default(   t   selft   itemst   _dictEntriest   namet   valuet   item(    (    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyR      s      c         C` s   t  i |  | |  i  S(   N(   R   t   getR   (   R   t   key(    (    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyt   __getitem__&   s    (    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyR      s   c         C` sl   t  |   d j oY t |  d  d j oB t |  d  d j o+ t |  d  d j o t |  d  d j S(   Ni   i    i   i  i   i   i  (   t   lent   ord(   t   data(    (    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyt   isSurrogatePair-   s    .c         C` s2   d t  |  d  d d t  |  d  d } | S(   Ni   i    i   i   i   i   (   R   (   R   t   char_val(    (    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyt   surrogatePairToCodepoint3   s    c         ` s   h      f d   } | S(   Nc         ` s   t  t i t d   o d |  i } n d |  i } |  j o	  | St |  }   |  | |  } | i i |  |  | <| Sd  S(   Nu    u   _%s_factorys   _%s_factory(   t
   isinstanceR   R   R   t   __dict__t   update(   t
   baseModulet   argst   kwargsR   t   modt   objs(   t   factoryt   moduleCache(    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyt   moduleFactory?   s    	
(    (   R)   R+   (    (   R)   R*   sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyt   moduleFactoryFactory<   s    (   t
   __future__R    R   R   t   typesR   t   xml.etree.cElementTreet   etreet   cElementTreet   default_etreet   ImportErrort   xml.etree.ElementTreet   ElementTreeR   R   R   R    R,   (    (    (    sU   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/utils.pyt   <module>   s   "			