;
-iAc           @   s   d  Z  d k l Z l Z d k l Z l Z d k Z d f  d     YZ	 d f  d     YZ
 d f  d	     YZ d
   Z e e e d  Z d S(   sI  
A simple guard framework for implementing web sites that only need
'Anonymous' vs 'Logged on' distinction, but nothing more.

If you need
 * multiple levels of access, or
 * multiple-interface applications, or
 * anything else more complex than 'Logged on' and 'Not logged on'

you need to use twisted.web.woven.guard directly.
(   s   portals   checkers(   s   resources   utilNs   Authenticatedc           B   s   t  Z e d  Z d   Z RS(   Nc         C   s   | |  _  d  S(   N(   s   names   self(   s   selfs   name(    (    s   C:\Python\PL\PL2_simpleguard.pys   __init__%   s    c         C   s   t  |  i  Sd  S(   N(   s   bools   selfs   name(   s   self(    (    s   C:\Python\PL\PL2_simpleguard.pys   __nonzero__(   s    (   s   __name__s
   __module__s   Nones   __init__s   __nonzero__(    (    (    s   C:\Python\PL\PL2_simpleguard.pys   Authenticated#   s   s   MarkAuthenticatedResourcec           B   s5   t  Z e i f Z e Z d   Z d   Z d   Z	 RS(   Nc         C   s   t  |  |  _ | |  _ d  S(   N(   s   Authenticateds   names   selfs   authenticateds   resource(   s   selfs   resources   name(    (    s   C:\Python\PL\PL2_simpleguard.pys   __init__2   s    c         C   s'   | i t |  i  |  i i |  Sd  S(   N(   s   requests   setComponents   Authenticateds   selfs   authenticateds   resources   render(   s   selfs   request(    (    s   C:\Python\PL\PL2_simpleguard.pys   render6   s    c         C   s*   | i t |  i  |  i i | |  Sd  S(   N(   s   requests   setComponents   Authenticateds   selfs   authenticateds   resources   getChildWithDefaults   path(   s   selfs   paths   request(    (    s   C:\Python\PL\PL2_simpleguard.pys   getChildWithDefault:   s    (
   s   __name__s
   __module__s   resources	   IResources   __implements__s   Falses   isLeafs   __init__s   renders   getChildWithDefault(    (    (    s   C:\Python\PL\PL2_simpleguard.pys   MarkAuthenticatedResource,   s
   		s   MarkingRealmc           B   s)   t  Z e i f Z e d  Z d   Z RS(   Nc         C   s&   | |  _  | p t | t  |  _ d  S(   N(   s   resources   selfs   nonauthenticateds   MarkAuthenticatedResources   None(   s   selfs   resources   nonauthenticated(    (    s   C:\Python\PL\PL2_simpleguard.pys   __init__C   s    	c         G   sd   t  i | j o t d   n | o# t  i t |  i  |  d   f Sn t  i |  i d   f Sd  S(   Ns   no interfacec           C   s   t  S(   N(   s   None(    (    (    s   C:\Python\PL\PL2_simpleguard.pys   <lambda>N   s    (   s   resources	   IResources
   interfacess   NotImplementedErrors   avatarIds   MarkAuthenticatedResources   selfs   nonauthenticated(   s   selfs   avatarIds   minds
   interfaces(    (    s   C:\Python\PL\PL2_simpleguard.pys   requestAvatarH   s
    #(   s   __name__s
   __module__s   portals   IRealms   __implements__s   Nones   __init__s   requestAvatar(    (    (    s   C:\Python\PL\PL2_simpleguard.pys   MarkingRealm?   s   c         C   s   t  i   Sd  S(   N(   s   utils   ParentRedirect(   s   _(    (    s   C:\Python\PL\PL2_simpleguard.pys   parentRedirectS   s    c         C   so   t  i t |  |   } x( | t i   g D] } | i
 |  q, Wt i | d | d | } t i |  Sd  S(   Ns   callbacks   errback(   s   portals   Portals   MarkingRealms   resources   nonauthenticateds   myPortals   checkerss   checkerslibs   AllowAnonymousAccesss   checkers   registerCheckers	   PL2_guards   UsernamePasswordWrappers   callbacks   errbacks   uns   SessionWrapper(   s   resources   checkerss   callbacks   errbacks   nonauthenticateds   myPortals   checkers   un(    (    s   C:\Python\PL\PL2_simpleguard.pys   guardResourceV   s     	(   s   __doc__s   twisted.creds   portals   checkerss   checkerslibs   twisted.webs   resources   utils	   PL2_guards   Authenticateds   MarkAuthenticatedResources   MarkingRealms   parentRedirects   Nones   guardResource(
   s   resources   parentRedirects   MarkAuthenticatedResources   utils   portals	   PL2_guards   Authenticateds   checkerslibs   guardResources   MarkingRealm(    (    s   C:\Python\PL\PL2_simpleguard.pys   ?   s   			