ó
[³XMc           @   s—   d  Z  d d l Z d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d l
 m Z m Z d Z d	 Z d
 e f d „  ƒ  YZ e ƒ  Z d S(   s;   
Cred plugin for a file of the format 'username:password'.
iÿÿÿÿN(   t
   implements(   t   plugin(   t   FilePasswordDB(   t   ICheckerFactory(   t   IUsernamePasswordt   IUsernameHashedPasswords¶   
This checker expects to receive the location of a file that
conforms to the FilePasswordDB format. Each line in the file
should be of the format 'username:password', in plain text.
s   Warning: not a valid filet   FileCheckerFactoryc           B   sN   e  Z d  Z e e e j ƒ d Z e Z	 d Z
 e e f Z e j Z d „  Z RS(   s7   
    A factory for instances of L{FilePasswordDB}.
    t   files,   Location of a FilePasswordDB-formatted file.c         C   sh   d d l  m } | j ƒ  s/ t d |  j ‚ n/ | | ƒ j ƒ  s^ |  j j d t | f ƒ n  t	 | ƒ S(   sÝ   
        This checker factory expects to get the location of a file.
        The file should conform to the format required by
        L{FilePasswordDB} (using defaults for all
        initialization parameters).
        iÿÿÿÿ(   t   FilePaths   %r requires a filenames   %s: %s
(
   t   twisted.python.filepathR   t   stript
   ValueErrort   authTypet   isfilet   errorOutputt   writet   invalidFileWarningR   (   t   selft	   argstringR   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/plugins/cred_file.pyt   generateChecker,   s    (   t   __name__t
   __module__t   __doc__R    R   R   t   IPluginR   t   fileCheckerFactoryHelpt   authHelpt   argStringFormatR   R   t   credentialInterfacest   syst   stderrR   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/plugins/cred_file.pyR      s   	(   R   R   t   zope.interfaceR    t   twistedR   t   twisted.cred.checkersR   t   twisted.cred.strcredR   t   twisted.cred.credentialsR   R   R   R   t   objectR   t   theFileCheckerFactory(    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/plugins/cred_file.pyt   <module>   s   