Ñò ô†³Kc@s<dZddklZdefd„ƒYZed„ZdS(s- Grant roles and logins based on IP address. iÿÿÿÿ(tip4tGrantIPMiddlewarecBs5eZdZed„Zd„Zd„Zd„ZRS(s On each request, ``ip_map`` is checked against ``REMOTE_ADDR`` and logins and roles are assigned based on that. ``ip_map`` is a map of {ip_mask: (username, roles)}. Either ``username`` or ``roles`` may be None. Roles may also be prefixed with ``-``, like ``'-system'`` meaning that role should be revoked. ``'__remove__'`` for a username will remove the username. If ``clobber_username`` is true (default) then any user specification will override the current value of ``REMOTE_USER``. ``'__remove__'`` will always clobber the username. ``ip_mask`` is something that `paste.util.ip4:IP4Range `_ can parse. Simple IP addresses, IP/mask, ip<->ip ranges, and hostnames are allowed. cCso||_g|_xM|iƒD]?\}}|iiti|ƒ|i|d|dƒfƒqW||_dS(Nii(tapptip_maptitemstappendRtIP4Ranget_convert_user_roletclobber_username(tselfRRRtkeytvalue((s6/usr/lib/python2.6/site-packages/paste/auth/grantip.pyt__init__s   "cCs4|o#t|tƒo|idƒ}n||fS(Nt,(t isinstancet basestringtsplit(R tusernametroles((s6/usr/lib/python2.6/site-packages/paste/auth/grantip.pyR$sc Csti|dtƒ}t}g}x‘|iD]†\}\}}||jog|o|i|ƒn|djo t}q²|o-|idƒ p |io||dsF